summaryrefslogtreecommitdiffstats
path: root/common/impl-parent
diff options
context:
space:
mode:
authorJan Srnicek <jsrnicek@cisco.com>2017-06-30 10:08:14 +0200
committerMarek Gradzki <mgradzki@cisco.com>2017-06-30 11:35:35 +0000
commit62dd4d32fd270d3a6b7bb47c972bbcd5dc7b9f43 (patch)
tree029ce8333a79393088a749dbf3575cd8c9c85c03 /common/impl-parent
parentef852789b2c156196a847b211066ae456c2683f5 (diff)
HONEYCOMB-358 - Generate guice to yang modules index
Generates two descriptor files yang-modules-binding/yang-modules - List of Yang modules by project(classpath + deps) yang-mapping/FULL_PROJECT_NAME-yang-modules-index - Index from Guice modules to Yang modules that are used by respective Guice module These files are included in jar files and distribution resources Change-Id: Iafc178219245df9129fb426a5876215c6fd1837e Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'common/impl-parent')
-rw-r--r--common/impl-parent/pom.xml78
1 files changed, 78 insertions, 0 deletions
diff --git a/common/impl-parent/pom.xml b/common/impl-parent/pom.xml
index 7d35518d7..65fb573c3 100644
--- a/common/impl-parent/pom.xml
+++ b/common/impl-parent/pom.xml
@@ -33,6 +33,7 @@
<guice.version>4.1.0</guice.version>
<guice.config.version>1.2.0</guice.config.version>
<skinny.logback.version>1.0.8</skinny.logback.version>
+ <maven-resources-plugin.version>3.0.2</maven-resources-plugin.version>
</properties>
<dependencyManagement>
@@ -68,4 +69,81 @@
</dependency>
</dependencies>
</dependencyManagement>
+
+ <build>
+ <pluginManagement>
+ <!-- Must be done in parent, to unpack jars for all projects that we generate yang module index for -->
+ <plugins> <!-- Copy all dependencies -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.10</version>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <!-- Must be done before generating yang to module index -->
+ <phase>process-sources</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/lib</outputDirectory>
+ <useBaseVersion>true</useBaseVersion>
+ <useRepositoryLayout>true</useRepositoryLayout>
+ <excludeArtifactIds>yang-jmx-generator,test-api</excludeArtifactIds>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- Generate module to yang provider index -->
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>groovy-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-yang-index</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>
+ io.fd.honeycomb.common.scripts.ModuleYangIndexGenerator.generateIndexForPresentModules(project, log)
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>io.fd.honeycomb.common</groupId>
+ <artifactId>common-scripts</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>groovy-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>${project.build.outputDirectory}</directory>
+ <includes>
+ <include>**/yang-modules-binding/yang-modules</include>
+ </includes>
+ </resource>
+ </resources>
+ </build>
</project>