This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Declarative support for creating projects from Archetypes | ||
---|---|---|---|
Product: | projects | Reporter: | Jaroslav Tulach <jtulach> |
Component: | Maven | Assignee: | Jaroslav Tulach <jtulach> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | apireviews, sdedic, tstupka |
Priority: | P3 | Keywords: | API_REVIEW_FAST |
Version: | Dev | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Initial sketch of how the support could work |
Description
Jaroslav Tulach
2016-10-25 13:24:31 UTC
Created attachment 162627 [details]
Initial sketch of how the support could work
I am trying to change the existing HTML UI Wizard to use the new FileBuilder API instead of direct DataObject.createFromTemplate - Sváťo, I hope that is move towards right direction.
The Maven project implements CreateFromTemplateHandler which recognizes property like files with extension ".archetype" that contain information like artifactId, groupId, version of the archetype and when instantiated they use "mvn" to create the project. Tomáši, is it OK approach?
I suffer writing tests. I am not sure if anyone tried to test instantiation of a maven archetype in a unit test. There are tons of problematic dependencies.
> The Maven project implements CreateFromTemplateHandler which recognizes property like files with extension ".archetype" > that contain information like artifactId, groupId, version of the archetype > and when instantiated they use "mvn" to create the project. Tomáši, is it OK approach? no objections > I suffer writing tests. I am not sure if anyone tried to test instantiation of a maven archetype in a unit test. There are tons of problematic dependencies. hm, when run from tests inputouput returns IOProvider.TrivialOW which runs into stactraceoverflow and mavenExecutor can't determine the maven executable home dir properly ... invoking via NbModuleSuite.createConfiguration(...) isn't an option? (In reply to Tomas Stupka from comment #2) > hm, when run from tests inputouput returns IOProvider.TrivialOW which runs > into stactraceoverflow and mavenExecutor can't determine the maven > executable home dir properly ... > invoking via NbModuleSuite.createConfiguration(...) isn't an option? I tried it, but then the layer generated by the test isn't found and maybe there were other problems. In the current version I replaced it with MockExecuteMaven, where I can just simulate what real Maven would do. Cleaned-up version that contains simple test that mocks the call into "mvn archetype": http://hg.netbeans.org/ergonomics/rev/76d9cafcee35 Here is the documentation for the "UI for Maven Archetype" feature: http://hg.netbeans.org/ergonomics/rev/ae57f97b7285 Here is a bit more test coverage: https://hg.netbeans.org/ergonomics/rev/580eb081e506 Unless there are objections, I will merge tomorrow. Integrated into 'main-silver', will be available in build *201611020002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/76d9cafcee35 User: Jaroslav Tulach <jtulach@netbeans.org> Log: #268677: Recognizing .archetype template files and using them to instantiate projects via mvn archetype Integrated into 'main-silver', will be available in build *201611060001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/34963a717456 User: Jaroslav Tulach <jtulach@netbeans.org> Log: #268677: Fixing broken link reference and adding apichanges note about the new Maven Archetype UI |