- Custom file as dependency
- projectfoo (pom)
- |- module1 (your binary dependency)
- L module2 (the module that needs your dependency)
- <groupId>com.dyan.sandbox</groupId>
- <artifactId>projectfoo</artifactId>
- <version>0.0.1</version>
- <packaging>pom</packaging>
- <modules>
- <module>module1</module>
- <module>module2</module>
- </modules>
- <parent>
- <groupId>com.dyan.sandbox</groupId>
- <artifactId>projectfoo</artifactId>
- <version>0.0.1</version>
- </parent>
- <groupId>com.dyan.sandbox.projectfoo</groupId>
- <artifactId>module1</artifactId>
- <version>0.0.1</version>
- <packaging>pom</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2</version>
- <executions>
- <execution>
- <id>make-your-resource</id>
- <goals>
- <goal>single</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/resources.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <assembly>
- <id>resources</id>
- <formats>
- <format>zip</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>src/main/resources/</directory>
- <outputDirectory>.</outputDirectory>
- </fileSet>
- </fileSets>
- </assembly>
- <groupId>com.dyan.sandbox.projectfoo</groupId>
- <artifactId>module2</artifactId>
- <version>0.0.1</version>
- <dependencies>
- <dependency>
- <groupId>com.dyan.sandbox.projectfoo</groupId>
- <artifactId>module1</artifactId>
- <version>0.0.1</version>
- <classifier>resources</classifier>
- <type>zip</type>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-your-resource</id>
- <goals>
- <goal>unpack-dependencies</goal>
- </goals>
- <phase>generate-resources</phase>
- <configuration>
- <!-- unzip the resources in compilation folder -->
- <outputDirectory>${project.build.directory}/classes</outputDirectory>
- <includeArtifactIds>module1</includeArtifactIds>
- <excludeTransitive>true</excludeTransitive>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>