From d77fdd6a0474a32c896903eae4453d800a7189cf Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Sun, 17 Dec 2017 01:44:59 -0500 Subject: [PATCH] Fix issues with the maven startup-archetype - The features-* pom only lists the odl-*-api feature as a dependency - it needs to also list the impl feature, and the cli and rest features. - With the above fix, we can uncomment the karaf.localFeature property in the karaf/pom so the rest feature is added to the featuresBoot. - Replaced the hardcoded X in the feature directory names (eg odl-X-api) with the variable __artifactId__. Also removed the elements for the hardcoded directory names in the archetype-metadata.xml and wildcarded the features so all child poms are included. - Fixed the "LineLength" checkstyle error in the *CliTestCommand class. However this class and *CliCommandsImpl contain imports for the generated package bame and thus could be in the incorrect lexicographical order for the CustomImportOrder checking. I tried @SuppressWarnings but it didn't work for that check but I placed the generated imports such that "org.opemdaylight.example" will work w/o error :) - The Integration Test (it/) is commented out in the modules due to CONTROLLER-1811. - The Integration Test (it/) project has an @Ignore due to CONTROLLER-1810. - The "it" project didn't build - this was b/c the pom had the incorrect for the features-* . - Changed the *IT class name to *Test so it runs with the normal "test" command rather than having to run "integration-test" which some users may not know to do. - Removed the left-over maven site generation stuff. Change-Id: I91c5747bf0defd635649d6f822e84bed810ee344 Signed-off-by: Tom Pantelis Signed-off-by: Michael Vorburger --- .../META-INF/maven/archetype-metadata.xml | 34 +------------ .../__classPrefix__CliTestCommand.java | 5 +- .../impl/__classPrefix__CliCommandsImpl.java | 4 +- .../archetype-resources/deploy-site.xml | 50 ------------------- .../pom.xml | 21 ++++++++ .../pom.xml | 0 .../pom.xml | 0 .../pom.xml | 0 .../{odl-X => odl-__artifactId__}/pom.xml | 0 .../archetype-resources/features/pom.xml | 10 ++-- .../resources/archetype-resources/it/pom.xml | 3 +- ...efix__IT.java => __classPrefix__Test.java} | 8 +-- .../archetype-resources/karaf/pom.xml | 2 +- .../resources/archetype-resources/pom.xml | 42 +--------------- opendaylight/md-sal/mdsal-it-parent/pom.xml | 15 +++++- 15 files changed, 55 insertions(+), 139 deletions(-) delete mode 100644 opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/deploy-site.xml rename opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/{features-X => features-__artifactId__}/pom.xml (69%) rename opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/{odl-X-api => odl-__artifactId__-api}/pom.xml (100%) rename opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/{odl-X-cli => odl-__artifactId__-cli}/pom.xml (100%) rename opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/{odl-X-rest => odl-__artifactId__-rest}/pom.xml (100%) rename opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/{odl-X => odl-__artifactId__}/pom.xml (100%) rename opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/it/src/test/java/__packageInPathFormat__/it/{__classPrefix__IT.java => __classPrefix__Test.java} (89%) 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 797e071b15..4419ac017a 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 @@ -35,7 +35,6 @@ .gitreview pom.xml - deploy-site.xml src/** @@ -52,40 +51,9 @@ features - pom.xml - - - - features/features-X - - pom.xml - - - - features/odl-X-api - - pom.xml + **/pom.xml - - features/odl-X - - pom.xml - - - - features/odl-X-cli - - pom.xml - - - - features/odl-X-rest - - pom.xml - - - impl diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/src/main/java/__packageInPathFormat__/cli/commands/__classPrefix__CliTestCommand.java b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/src/main/java/__packageInPathFormat__/cli/commands/__classPrefix__CliTestCommand.java index 65ec5f750d..d3adf67446 100644 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/src/main/java/__packageInPathFormat__/cli/commands/__classPrefix__CliTestCommand.java +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/src/main/java/__packageInPathFormat__/cli/commands/__classPrefix__CliTestCommand.java @@ -21,7 +21,8 @@ import org.slf4j.LoggerFactory; * This is an example class. The class name can be renamed to match the command implementation that it will invoke. * Specify command details by updating the fields in the Command annotation below. */ -@Command(name = "test-command", scope = "add the scope of the command, usually project name", description = "add a description for the command") +@Command(name = "test-command", scope = "add the scope of the command, usually project name", + description = "add a description for the command") public class ${classPrefix}CliTestCommand extends AbstractAction { private static final Logger LOG = LoggerFactory.getLogger(${classPrefix}CliTestCommand.class); @@ -53,4 +54,4 @@ public class ${classPrefix}CliTestCommand extends AbstractAction { final String testMessage = (String) service.testCommand(testArgument); return testMessage; } -} \ No newline at end of file +} diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/src/main/java/__packageInPathFormat__/cli/impl/__classPrefix__CliCommandsImpl.java b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/src/main/java/__packageInPathFormat__/cli/impl/__classPrefix__CliCommandsImpl.java index 62ca5aa2ac..b7f50372c1 100644 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/src/main/java/__packageInPathFormat__/cli/impl/__classPrefix__CliCommandsImpl.java +++ b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/src/main/java/__packageInPathFormat__/cli/impl/__classPrefix__CliCommandsImpl.java @@ -11,9 +11,9 @@ package ${package}.cli.impl; import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import ${package}.cli.api.${classPrefix}CliCommands; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import ${package}.cli.api.${classPrefix}CliCommands; public class ${classPrefix}CliCommandsImpl implements ${classPrefix}CliCommands { @@ -29,4 +29,4 @@ public class ${classPrefix}CliCommandsImpl implements ${classPrefix}CliCommands public Object testCommand(Object testArgument) { return "This is a test implementation of test-command"; } -} \ No newline at end of file +} diff --git a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/deploy-site.xml b/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/deploy-site.xml deleted file mode 100644 index e2ca41ca08..0000000000 --- a/opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/deploy-site.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - 4.0.0 - - ${groupId} - deploy-site - ${version} - pom - - - latest - dav:https://nexus.opendaylight.org/content/sites/site/${project.groupId}/${stream}/ - - - - - - org.apache.maven.wagon - wagon-webdav-jackrabbit - 2.9 - - - - - - org.apache.maven.plugins - maven-site-plugin - 3.4 - - ${project.build.directory}/staged-site - - - - - - - - opendaylight-site - ${nexus.site.url} - - - 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-__artifactId__/pom.xml similarity index 69% rename from opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/features-X/pom.xml rename to opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/features-__artifactId__/pom.xml index b25d844128..da10e0da80 100644 --- 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-__artifactId__/pom.xml @@ -44,5 +44,26 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL xml features + + ${symbol_dollar}{project.groupId} + odl-${artifactId} + ${symbol_dollar}{project.version} + xml + features + + + ${symbol_dollar}{project.groupId} + odl-${artifactId}-cli + ${symbol_dollar}{project.version} + xml + features + + + ${symbol_dollar}{project.groupId} + odl-${artifactId}-rest + ${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-__artifactId__-api/pom.xml similarity index 100% rename from opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X-api/pom.xml rename to opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-__artifactId__-api/pom.xml 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-__artifactId__-cli/pom.xml similarity index 100% rename from opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X-cli/pom.xml rename to opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-__artifactId__-cli/pom.xml 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-__artifactId__-rest/pom.xml similarity index 100% rename from opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X-rest/pom.xml rename to opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-__artifactId__-rest/pom.xml 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-__artifactId__/pom.xml similarity index 100% rename from opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X/pom.xml rename to opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-__artifactId__/pom.xml 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 05ac9c9ecd..6442af3a50 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 @@ -27,10 +27,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL ODL :: ${groupId} :: ${project.artifactId} - features-X - odl-X-api - odl-X - odl-X-rest - odl-X-cli + features-${artifactId} + odl-${artifactId}-api + odl-${artifactId} + odl-${artifactId}-rest + odl-${artifactId}-cli 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 5a64837725..6115ec4f13 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 @@ -23,7 +23,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html ODL :: ${groupId} :: ${project.artifactId} - bundle false @@ -38,6 +37,8 @@ and is available at http://www.eclipse.org/legal/epl-v10.html ${project.groupId} features-${artifactId} ${project.version} + xml + features 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__Test.java similarity index 89% rename from opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/it/src/test/java/__packageInPathFormat__/it/__classPrefix__IT.java rename to opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/it/src/test/java/__packageInPathFormat__/it/__classPrefix__Test.java index 23fb24d4e8..6f983957b6 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__Test.java @@ -15,6 +15,7 @@ import static org.ops4j.pax.exam.CoreOptions.maven; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase; @@ -29,8 +30,8 @@ import org.slf4j.LoggerFactory; @RunWith(PaxExam.class) @ExamReactorStrategy(PerClass.class) -public class ${classPrefix}IT extends AbstractMdsalTestBase { - private static final Logger LOG = LoggerFactory.getLogger(${classPrefix}IT.class); +public class ${classPrefix}Test extends AbstractMdsalTestBase { + private static final Logger LOG = LoggerFactory.getLogger(${classPrefix}Test.class); @Override public MavenUrlReference getFeatureRepo() { @@ -50,13 +51,14 @@ public class ${classPrefix}IT extends AbstractMdsalTestBase { @Override public Option getLoggingOption() { Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG, - logConfiguration(${classPrefix}IT.class), + logConfiguration(${classPrefix}Test.class), LogLevel.INFO.name()); option = composite(option, super.getLoggingOption()); return option; } @Test + @Ignore // TODO https://jira.opendaylight.org/browse/CONTROLLER-1810 public void test${artifactId}FeatureLoad() { Assert.assertTrue(true); } 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 a7c4ddc3c1..70ce0e6d95 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 @@ -27,7 +27,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL ODL :: ${groupId} :: ${project.artifactId} - + odl-${artifactId}-rest 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 c94f49b063..98a8ab6e60 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 - + @@ -58,44 +58,4 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL - - - - maven-site - - - ${user.dir}/deploy-site.xml - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - false - - - aggregate - - aggregate - - package - - - - - maven-checkstyle-plugin - - true - - - - - - - diff --git a/opendaylight/md-sal/mdsal-it-parent/pom.xml b/opendaylight/md-sal/mdsal-it-parent/pom.xml index ec7154cebc..178139d6ba 100644 --- a/opendaylight/md-sal/mdsal-it-parent/pom.xml +++ b/opendaylight/md-sal/mdsal-it-parent/pom.xml @@ -7,6 +7,7 @@ terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html --> + 4.0.0 org.opendaylight.odlparent @@ -14,11 +15,12 @@ and is available at http://www.eclipse.org/legal/epl-v10.html 3.0.2 - 4.0.0 + org.opendaylight.controller mdsal-it-parent 1.7.0-SNAPSHOT pom + 1.7.0-SNAPSHOT org.opendaylight.odlparent @@ -27,6 +29,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html zip false + @@ -126,6 +129,16 @@ and is available at http://www.eclipse.org/legal/epl-v10.html + + maven-surefire-plugin + ${maven.surefire.version} + + + + ${settings.localRepository} + + + org.apache.maven.plugins maven-failsafe-plugin -- 2.36.6