I have created some sub folders in src/main/resources that I would like to include in the final artifact.jar file.
<build>
<resources>
<resource>
<directory>src/main/resources/</directory>
</resource>
<resource>
<directory>src/main/resources/logs</directory>
</resource>
<resource>
<directory>src/main/resources/data</directory>
</resource>
</resources>
...
Next I copy these resources to the target folder:
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<outputDirectory>${target.basedir}</outputDirectory>
<includeEmptyDirs>true</includeEmptyDirs>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</configuration>
<executions>
<execution>
<id>copy-resources</id>
<phase>packaging</phase>
<goals>
<goal>copy-resources</goal>
</goals>
</execution>
</executions>
</plugin>
Further I use the maven-dependency-plugin during compile time to fetch
some dependencies from nexus and copy those the /target folder.
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-and-unpack</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.test</groupId>
<artifactId>assembly</artifactId>
<version>1.0.1</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${target.basedir}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
These dependencies should also be included in the final artifact.jar
file. But after I have run mvn clean install the artifact.jar file
only contains the manifest file.
How do I include resources from the project and target folder i the
final artifact.jar file?
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
