Fix issues with the maven startup-archetype 45/66545/5
authorTom Pantelis <tompantelis@gmail.com>
Sun, 17 Dec 2017 06:44:59 +0000 (01:44 -0500)
committerMichael Vorburger <vorburger@redhat.com>
Tue, 23 Jan 2018 02:25:02 +0000 (02:25 +0000)
- 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 <fileSet> elements
  for the hardcoded directory names in the archetype-metadata.xml and
  wildcarded the features <fileSet> 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
  <type> for the features-* <dependency>.

- 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 <tompantelis@gmail.com>
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
15 files changed:
opendaylight/archetypes/opendaylight-startup/src/main/resources/META-INF/maven/archetype-metadata.xml
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/src/main/java/__packageInPathFormat__/cli/commands/__classPrefix__CliTestCommand.java
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/cli/src/main/java/__packageInPathFormat__/cli/impl/__classPrefix__CliCommandsImpl.java
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/deploy-site.xml [deleted file]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/features-__artifactId__/pom.xml [moved from opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/features-X/pom.xml with 69% similarity]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-__artifactId__-api/pom.xml [moved from opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X-api/pom.xml with 100% similarity]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-__artifactId__-cli/pom.xml [moved from opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X-cli/pom.xml with 100% similarity]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-__artifactId__-rest/pom.xml [moved from opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X-rest/pom.xml with 100% similarity]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-__artifactId__/pom.xml [moved from opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/odl-X/pom.xml with 100% similarity]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/features/pom.xml
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/it/pom.xml
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/it/src/test/java/__packageInPathFormat__/it/__classPrefix__Test.java [moved from opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/it/src/test/java/__packageInPathFormat__/it/__classPrefix__IT.java with 89% similarity]
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/karaf/pom.xml
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/pom.xml
opendaylight/md-sal/mdsal-it-parent/pom.xml

index 797e071..4419ac0 100644 (file)
@@ -35,7 +35,6 @@
       <includes>
         <include>.gitreview</include>
         <include>pom.xml</include>
-        <include>deploy-site.xml</include>
         <include>src/**</include>
       </includes>
     </fileSet>
     <fileSet filtered="true" encoding="UTF-8">
         <directory>features</directory>
         <includes>
-            <include>pom.xml</include>
-        </includes>
-    </fileSet>
-    <fileSet filtered="true" encoding="UTF-8">
-        <directory>features/features-X</directory>
-        <includes>
-            <include>pom.xml</include>
-        </includes>
-    </fileSet>
-    <fileSet filtered="true" encoding="UTF-8">
-        <directory>features/odl-X-api</directory>
-        <includes>
-            <include>pom.xml</include>
+            <include>**/pom.xml</include>
         </includes>
     </fileSet>
-    <fileSet filtered="true" encoding="UTF-8">
-        <directory>features/odl-X</directory>
-        <includes>
-            <include>pom.xml</include>
-        </includes>
-    </fileSet>
-    <fileSet filtered="true" encoding="UTF-8">
-        <directory>features/odl-X-cli</directory>
-        <includes>
-            <include>pom.xml</include>
-        </includes>
-    </fileSet>
-    <fileSet filtered="true" encoding="UTF-8">
-        <directory>features/odl-X-rest</directory>
-        <includes>
-            <include>pom.xml</include>
-        </includes>
-    </fileSet>
-
     <!-- impl -->
     <fileSet filtered="true" encoding="UTF-8">
         <directory>impl</directory>
index 65ec5f7..d3adf67 100644 (file)
@@ -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
+}
index 62ca5aa..b7f5037 100644 (file)
@@ -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 (file)
index e2ca41c..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=2 tabstop=2: -->
-<!--
-    Copyright (c) ${copyrightYear} ${copyright} and others.  All rights reserved.
-
-    This program and the accompanying materials are made available under the
-    terms of the Eclipse Public License v1.0 which accompanies this distribution,
-    and is available at http://www.eclipse.org/legal/epl-v10.html
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <groupId>${groupId}</groupId>
-  <artifactId>deploy-site</artifactId>
-  <version>${version}</version>
-  <packaging>pom</packaging>
-
-  <properties>
-    <stream>latest</stream>
-    <nexus.site.url>dav:https://nexus.opendaylight.org/content/sites/site/${project.groupId}/${stream}/</nexus.site.url>
-  </properties>
-
-  <build>
-    <extensions>
-      <extension>
-        <groupId>org.apache.maven.wagon</groupId>
-         <artifactId>wagon-webdav-jackrabbit</artifactId>
-         <version>2.9</version>
-      </extension>
-    </extensions>
-
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-site-plugin</artifactId>
-        <version>3.4</version>
-        <configuration>
-          <inputDirectory>${project.build.directory}/staged-site</inputDirectory>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-  <distributionManagement>
-    <site>
-      <id>opendaylight-site</id>
-      <url>${nexus.site.url}</url>
-    </site>
-  </distributionManagement>
-</project>
@@ -44,5 +44,26 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
       <type>xml</type>
       <classifier>features</classifier>
     </dependency>
+    <dependency>
+      <groupId>${symbol_dollar}{project.groupId}</groupId>
+      <artifactId>odl-${artifactId}</artifactId>
+      <version>${symbol_dollar}{project.version}</version>
+      <type>xml</type>
+      <classifier>features</classifier>
+    </dependency>
+    <dependency>
+      <groupId>${symbol_dollar}{project.groupId}</groupId>
+      <artifactId>odl-${artifactId}-cli</artifactId>
+      <version>${symbol_dollar}{project.version}</version>
+      <type>xml</type>
+      <classifier>features</classifier>
+    </dependency>
+    <dependency>
+      <groupId>${symbol_dollar}{project.groupId}</groupId>
+      <artifactId>odl-${artifactId}-rest</artifactId>
+      <version>${symbol_dollar}{project.version}</version>
+      <type>xml</type>
+      <classifier>features</classifier>
+    </dependency>
   </dependencies>
 </project>
index 05ac9c9..6442af3 100644 (file)
@@ -27,10 +27,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
   <name>ODL :: ${groupId} :: ${project.artifactId}</name>
 
   <modules>
-    <module>features-X</module>
-    <module>odl-X-api</module>
-    <module>odl-X</module>
-    <module>odl-X-rest</module>
-    <module>odl-X-cli</module>
+    <module>features-${artifactId}</module>
+    <module>odl-${artifactId}-api</module>
+    <module>odl-${artifactId}</module>
+    <module>odl-${artifactId}-rest</module>
+    <module>odl-${artifactId}-cli</module>
   </modules>
 </project>
index 5a64837..6115ec4 100644 (file)
@@ -23,7 +23,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <!-- <name> formatting is used by autorelease to parse and notify projects on
        build failure. Please do not modify this unless you have a good reason. -->
   <name>ODL :: ${groupId} :: ${project.artifactId}</name>
-  <packaging>bundle</packaging>
 
   <properties>
     <skipITs>false</skipITs>
@@ -38,6 +37,8 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <groupId>${project.groupId}</groupId>
       <artifactId>features-${artifactId}</artifactId>
       <version>${project.version}</version>
+      <type>xml</type>
+      <classifier>features</classifier>
     </dependency>
   </dependencies>
 </project>
@@ -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);
     }
index a7c4ddc..70ce0e6 100644 (file)
@@ -27,7 +27,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
   <name>ODL :: ${groupId} :: ${project.artifactId}</name>
 
   <properties>
-    <!-- TODO <karaf.localFeature>odl-${artifactId}-rest</karaf.localFeature> -->
+    <karaf.localFeature>odl-${artifactId}-rest</karaf.localFeature>
   </properties>
 
   <dependencyManagement>
index c94f49b..98a8ab6 100644 (file)
@@ -35,7 +35,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
     <module>features</module>
     <module>artifacts</module>
     <module>cli</module>
-    <!-- <module>it</module> -->
+    <!-- TODO CONTROLLER-1811 *and* then CONTROLLER-1810: <module>it</module> -->
   </modules>
 
   <!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
@@ -58,44 +58,4 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
     </plugins>
   </build>
 
-  <profiles>
-    <profile>
-      <!--
-          This profile is to ensure we only build javadocs reports
-          when we plan to deploy Maven site for our project.
-      -->
-      <id>maven-site</id>
-      <activation>
-        <file>
-          <exists>${user.dir}/deploy-site.xml</exists>
-        </file>
-      </activation>
-
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-javadoc-plugin</artifactId>
-            <inherited>false</inherited>
-            <executions>
-              <execution>
-                <id>aggregate</id>
-                <goals>
-                  <goal>aggregate</goal>
-                </goals>
-                <phase>package</phase>
-              </execution>
-            </executions>
-          </plugin>
-          <plugin>
-            <artifactId>maven-checkstyle-plugin</artifactId>
-            <configuration>
-              <failsOnError>true</failsOnError>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
-
 </project>
index ec7154c..178139d 100644 (file)
@@ -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
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
 
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
@@ -14,11 +15,12 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <version>3.0.2</version>
     <relativePath/>
   </parent>
-  <modelVersion>4.0.0</modelVersion>
+
   <groupId>org.opendaylight.controller</groupId>
   <artifactId>mdsal-it-parent</artifactId>
   <version>1.7.0-SNAPSHOT</version>
   <packaging>pom</packaging>
+
   <properties>
     <mdsal.version>1.7.0-SNAPSHOT</mdsal.version>
     <karaf.distro.groupId>org.opendaylight.odlparent</karaf.distro.groupId>
@@ -27,6 +29,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <karaf.distro.type>zip</karaf.distro.type>
     <karaf.keep.unpack>false</karaf.keep.unpack>
   </properties>
+
   <dependencyManagement>
     <dependencies>
       <dependency>
@@ -126,6 +129,16 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   </dependencies>
   <build>
     <plugins>
+      <plugin>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>${maven.surefire.version}</version>
+          <configuration>
+              <systemPropertyVariables>
+                <!-- CONTROLLER-1799: Use the same repository for Pax Exam as is used for Maven -->
+                <org.ops4j.pax.url.mvn.localRepository>${settings.localRepository}</org.ops4j.pax.url.mvn.localRepository>
+              </systemPropertyVariables>
+          </configuration>
+      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-failsafe-plugin</artifactId>

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.