From: Michael Vorburger Date: Thu, 26 May 2016 13:34:57 +0000 (+0200) Subject: Bug 8741: Fix broken Maven archetype X-Git-Tag: release/oxygen~99 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=c0e813ca83ce80d5f3fb340175ddaecd780c6aea Bug 8741: Fix broken Maven archetype Includes migration to Karaf 4 features, as per https://wiki.opendaylight.org/view/Karaf_4_migration The main goal here was just to get what I've found to be a completely badly broken archetype; it even had some other other problems unrelated to Karaf 4 migration; this looks like it had been haywire for quite a while even before the Karaf 4 migration already? This also contributes a basis for future automated self testing; see also http://blog2.vorburger.ch/2016/05/how-to-make-maven-archetype-plugin.html, but this is skipped in this change, because while it works great locally, it fails for some strange reason related to SFT on (only) Jenkins. I'm hoping that this just a very first step to ongoing active maintenance of the archetype (by myself, but hopefully others too), without ever breaking it anymore - thanks to the new self test. Here are some possible future TBDs: * remove archetype.test.skip and fix weird SFT problem (@vorburger) * re-activate commented out IT which breaks during build self test * odl-X* feature directory names with ${artifactId} instead of X (dunno how to get archetype to create folders named by variables) * karaf.localFeature which breaks during build self test * some clean-up e.g. remove useless site generation? * real test of the produced Karaf distro? Using Pax Exam, but not *IT.. Change-Id: I013c305fb9b63cc965cbcc112cbe6017ae47de21 Signed-off-by: Michael Vorburger --- diff --git a/opendaylight/archetypes/opendaylight-startup/pom.xml b/opendaylight/archetypes/opendaylight-startup/pom.xml index 51a21cd5be..0bfc27faaf 100644 --- a/opendaylight/archetypes/opendaylight-startup/pom.xml +++ b/opendaylight/archetypes/opendaylight-startup/pom.xml @@ -14,14 +14,4 @@ maven-archetype ${project.artifactId} - - - - maven-checkstyle-plugin - - true - - - - diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/META-INF/maven/archetype-metadata.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/META-INF/maven/archetype-metadata.xml index 72d36c879a..797e071b15 100644 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -2,6 +2,7 @@ + @@ -48,7 +49,6 @@ - features @@ -56,14 +56,37 @@ - features/src/main/features + features/features-X - **/*.xml - + pom.xml + + + + features/odl-X-api + + pom.xml + + + + features/odl-X + + pom.xml + + + + features/odl-X-cli + + pom.xml + + + + features/odl-X-rest + + pom.xml + - impl @@ -90,7 +113,6 @@ - api diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/api/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/api/pom.xml index eb64ff6e89..c97c3e8751 100644 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/api/pom.xml +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/api/pom.xml @@ -8,7 +8,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html --> - 4.0.0 diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/api/src/main/yang/__artifactId__.yang b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/api/src/main/yang/__artifactId__.yang index 75eb8e3674..848cf4831d 100644 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/api/src/main/yang/__artifactId__.yang +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/api/src/main/yang/__artifactId__.yang @@ -6,7 +6,7 @@ module ${artifactId} { namespace "urn:opendaylight:params:xml:ns:yang:${artifactId}"; prefix "${artifactId}"; - revision "${date}" { + revision "2017-08-30" { // TODO change revision to date of model creation description "Initial revision of ${artifactId} model"; } } diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/artifacts/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/artifacts/pom.xml index 4525c5d89d..8184bdf86c 100644 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/artifacts/pom.xml +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/artifacts/pom.xml @@ -11,7 +11,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html --> - 4.0.0 @@ -43,7 +42,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html ${symbol_dollar}{project.groupId} - ${artifactId}-features + features-${artifactId} ${symbol_dollar}{project.version} features xml diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/pom.xml index 79ae689bec..fa0c1fb5b3 100644 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/pom.xml +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/pom.xml @@ -12,7 +12,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html --> - 4.0.0 @@ -30,6 +29,18 @@ and is available at http://www.eclipse.org/legal/epl-v10.html ODL :: ${groupId} :: ${project.artifactId} bundle + + + + org.opendaylight.controller + mdsal-artifacts + 1.7.0-SNAPSHOT + pom + import + + + + @@ -38,6 +49,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html ${symbol_dollar}{project.version} + + org.opendaylight.controller + sal-binding-api + + org.apache.karaf.shell diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/src/main/resources/org/opendaylight/blueprint/cli-blueprint.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/src/main/resources/org/opendaylight/blueprint/cli-blueprint.xml index 5c3bd4d43f..c53c19d7af 100644 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/src/main/resources/org/opendaylight/blueprint/cli-blueprint.xml +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/src/main/resources/org/opendaylight/blueprint/cli-blueprint.xml @@ -21,14 +21,15 @@ and is available at http://www.eclipse.org/legal/epl-v10.html + - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/features-X/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/features-X/pom.xml new file mode 100644 index 0000000000..783b8435af --- /dev/null +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/features-X/pom.xml @@ -0,0 +1,48 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + 4.0.0 + + + org.opendaylight.odlparent + feature-repo-parent + 2.0.4 + + + + ${groupId} + features-${artifactId} + ${version} + feature + + ODL :: ${groupId} :: ${project.artifactId} + + + 0.12.0-SNAPSHOT + 1.7.0-SNAPSHOT + 1.7.0-SNAPSHOT + 2.0.0-SNAPSHOT + etc/opendaylight/karaf + + + + + ${symbol_dollar}{project.groupId} + odl-${artifactId}-api + ${symbol_dollar}{project.version} + xml + features + + + diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X-api/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X-api/pom.xml new file mode 100644 index 0000000000..72b657d38a --- /dev/null +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X-api/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + + org.opendaylight.odlparent + single-feature-parent + 2.0.4 + + + + ${groupId} + odl-${artifactId}-api + ${version} + feature + + OpenDaylight :: ${artifactId} :: API [Karaf Feature] + + + + + org.opendaylight.mdsal.model + mdsal-model-artifacts + 0.12.0-SNAPSHOT + pom + import + + + org.opendaylight.controller + mdsal-artifacts + 1.7.0-SNAPSHOT + pom + import + + + + + + + org.opendaylight.mdsal.model + odl-mdsal-models + xml + features + + + ${project.groupId} + ${artifactId}-api + ${project.version} + + + + diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X-cli/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X-cli/pom.xml new file mode 100644 index 0000000000..b513ebf91f --- /dev/null +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X-cli/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + + org.opendaylight.odlparent + single-feature-parent + 2.0.4 + + + + ${groupId} + odl-${artifactId}-cli + ${version} + feature + + OpenDaylight :: ${artifactId} :: CLI [Karaf Feature] + + + + + org.opendaylight.mdsal.model + mdsal-model-artifacts + 0.12.0-SNAPSHOT + pom + import + + + org.opendaylight.controller + mdsal-artifacts + 1.7.0-SNAPSHOT + pom + import + + + + + + + ${project.groupId} + odl-${artifactId} + ${project.version} + xml + features + + + ${project.groupId} + ${artifactId}-cli + ${project.version} + + + + diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X-rest/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X-rest/pom.xml new file mode 100644 index 0000000000..9376de528c --- /dev/null +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X-rest/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + + + org.opendaylight.odlparent + single-feature-parent + 2.0.4 + + + + ${groupId} + odl-${artifactId}-rest + ${version} + feature + + OpenDaylight :: ${artifactId} :: REST [Karaf Feature] + + + + + org.opendaylight.netconf + restconf-artifacts + 1.7.0-SNAPSHOT + pom + import + + + + + + + org.opendaylight.netconf + odl-restconf + xml + features + + + ${project.groupId} + odl-${artifactId}-cli + ${project.version} + xml + features + + + + diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X/pom.xml new file mode 100644 index 0000000000..a91490136a --- /dev/null +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + + org.opendaylight.odlparent + single-feature-parent + 2.0.4 + + + + ${groupId} + odl-${artifactId} + ${version} + feature + + OpenDaylight :: ${artifactId} :: Impl [Karaf Feature] + + + + + org.opendaylight.mdsal.model + mdsal-model-artifacts + 0.12.0-SNAPSHOT + pom + import + + + org.opendaylight.controller + mdsal-artifacts + 1.7.0-SNAPSHOT + pom + import + + + + + + + org.opendaylight.controller + odl-mdsal-broker + xml + features + + + ${project.groupId} + odl-${artifactId}-api + ${project.version} + xml + features + + + ${project.groupId} + ${artifactId}-impl + ${project.version} + + + + diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/pom.xml index 990bca22e0..4b3373f66e 100644 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/pom.xml +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/pom.xml @@ -11,102 +11,26 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL --> - 4.0.0 org.opendaylight.odlparent - features-parent + odlparent-lite 2.0.4 ${groupId} - ${artifactId}-features + ${artifactId}-features-aggregator ${version} - + pom ODL :: ${groupId} :: ${project.artifactId} - - 0.12.0-SNAPSHOT - 1.7.0-SNAPSHOT - 1.7.0-SNAPSHOT - 2.0.0-SNAPSHOT - etc/opendaylight/karaf - - - - - - - org.opendaylight.controller - mdsal-artifacts - ${mdsal.version} - pom - import - - - org.opendaylight.netconf - restconf-artifacts - ${restconf.version} - pom - import - - - org.opendaylight.yangtools - yangtools-artifacts - ${yangtools.version} - pom - import - - - - - - - org.opendaylight.yangtools - features-yangtools - features - xml - runtime - - - org.opendaylight.mdsal.model - features-mdsal-model - ${mdsal.model.version} - features - xml - runtime - - - org.opendaylight.controller - features-mdsal - features - xml - runtime - - - org.opendaylight.netconf - features-restconf - features - xml - runtime - - - ${symbol_dollar}{project.groupId} - ${artifactId}-impl - ${symbol_dollar}{project.version} - - - ${symbol_dollar}{project.groupId} - ${artifactId}-api - ${symbol_dollar}{project.version} - - - ${symbol_dollar}{project.groupId} - ${artifactId}-cli - ${symbol_dollar}{project.version} - - + + features-X + odl-X-api + odl-X + odl-X-rest + odl-X-cli + diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/src/main/features/features.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/src/main/features/features.xml deleted file mode 100644 index 97d13a3275..0000000000 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/src/main/features/features.xml +++ /dev/null @@ -1,38 +0,0 @@ -#set( $symbol_pound = '#' ) -#set( $symbol_dollar = '$' ) -#set( $symbol_escape = '\' ) - - - - - mvn:org.opendaylight.yangtools/features-yangtools/{{VERSION}}/xml/features - mvn:org.opendaylight.controller/features-mdsal/{{VERSION}}/xml/features - mvn:org.opendaylight.mdsal.model/features-mdsal-model/{{VERSION}}/xml/features - mvn:org.opendaylight.netconf/features-restconf/{{VERSION}}/xml/features - - odl-mdsal-models - mvn:${groupId}/${artifactId}-api/{{VERSION}} - - - odl-mdsal-broker - odl-${artifactId}-api - mvn:${groupId}/${artifactId}-impl/{{VERSION}} - - - odl-${artifactId} - odl-restconf - - - odl-${artifactId} - mvn:${groupId}/${artifactId}-cli/{{VERSION}} - - - diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/impl/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/impl/pom.xml index d046a95f07..5f5e7d5bc1 100644 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/impl/pom.xml +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/impl/pom.xml @@ -12,7 +12,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html --> - 4.0.0 @@ -30,6 +29,18 @@ and is available at http://www.eclipse.org/legal/epl-v10.html ODL :: ${groupId} :: ${project.artifactId} bundle + + + + org.opendaylight.controller + mdsal-artifacts + 1.7.0-SNAPSHOT + pom + import + + + + ${symbol_dollar}{project.groupId} @@ -37,6 +48,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html ${symbol_dollar}{project.version} + + org.opendaylight.controller + sal-binding-api + + junit diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/it/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/it/pom.xml index 7d3d398f9b..5a64837725 100644 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/it/pom.xml +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/it/pom.xml @@ -8,7 +8,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html --> - 4.0.0 @@ -37,7 +36,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html ${project.groupId} - ${artifactId}-features + features-${artifactId} ${project.version} diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/it/src/test/java/__packageInPathFormat__/it/__classPrefix__IT.java b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/it/src/test/java/__packageInPathFormat__/it/__classPrefix__IT.java index 33b648434a..23fb24d4e8 100644 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/it/src/test/java/__packageInPathFormat__/it/__classPrefix__IT.java +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/it/src/test/java/__packageInPathFormat__/it/__classPrefix__IT.java @@ -36,7 +36,7 @@ public class ${classPrefix}IT extends AbstractMdsalTestBase { public MavenUrlReference getFeatureRepo() { return maven() .groupId("${groupId}") - .artifactId("${artifactId}-features") + .artifactId("features-${artifactId}") .classifier("features") .type("xml") .versionAsInProject(); @@ -44,7 +44,7 @@ public class ${classPrefix}IT extends AbstractMdsalTestBase { @Override public String getFeatureName() { - return "odl-${artifactId}-ui"; + return "odl-${artifactId}-rest"; } @Override diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/karaf/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/karaf/pom.xml index 8825453460..d36e06d5e0 100644 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/karaf/pom.xml +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/karaf/pom.xml @@ -10,13 +10,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL --> - 4.0.0 org.opendaylight.odlparent - karaf-parent + karaf4-parent 2.0.4 + ${groupId} @@ -27,7 +27,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL ODL :: ${groupId} :: ${project.artifactId} - odl-${artifactId}-ui + @@ -53,7 +53,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL ${symbol_dollar}{project.groupId} - ${artifactId}-features + features-${artifactId} features xml runtime diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/pom.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/pom.xml index 0bc86b9955..bd700f0920 100644 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/pom.xml +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/pom.xml @@ -35,7 +35,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL features artifacts cli - it + diff --git a/opendaylight/archetypes/opendaylight-startup/src/test/resources/projects/basic/goal.txt b/opendaylight/archetypes/opendaylight-startup/src/test/resources/projects/basic/goal.txt index e69de29bb2..7c32f55981 100644 --- a/opendaylight/archetypes/opendaylight-startup/src/test/resources/projects/basic/goal.txt +++ b/opendaylight/archetypes/opendaylight-startup/src/test/resources/projects/basic/goal.txt @@ -0,0 +1 @@ +install diff --git a/opendaylight/archetypes/pom.xml b/opendaylight/archetypes/pom.xml index cb05da2027..7ffd22c1d3 100644 --- a/opendaylight/archetypes/pom.xml +++ b/opendaylight/archetypes/pom.xml @@ -14,29 +14,23 @@ 0.7.0-SNAPSHOT pom + + + 3.0.1 + + true + + org.apache.maven.archetype archetype-packaging - 2.4 + ${maven.archetype.version} - - - - maven-archetype-plugin - 2.4 - - - commons-lang - commons-lang - 2.6 - - - - - + org.apache.maven.plugins @@ -46,6 +40,36 @@ false + + maven-help-plugin + 2.2 + + ${project.build.directory}/effective-settings.xml + + + + + pre-integration-test + + effective-settings + + + + + + maven-archetype-plugin + ${maven.archetype.version} + + ${project.build.directory}/effective-settings.xml + + + + commons-lang + commons-lang + 2.6 + + +