I am building a simple Jar project with maven(latest)
When running maven package, I get the jar file at the target directory correctly,
I would like to customize the output so maven will copy some files and dependencies to the target alongside the jar.
目前的组合结构是:
/
-- resources
-- src/main/java/com..(project sources)
-- src/main/assembly (location of the assebmly.xml)
理想的目录结构是:
target
|
-- myJar1.0.jar (the artiface)
-- resources (from the root build folder)
-- lib (all the dependancies)
|
-- anotherJar-1.0.jar
-- anotherJar2-1.0.jar
-- anotherJar3-1.0.jar
I read custom assembly on apache web site,
I added the configuration to maven-assembly-plugin and configured the assembly.xml
but I must do something wrong, I dont get the correct output,
页: 1
<assembly>
<id/>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>/lib</outputDirectory>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>target</directory>
<outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<fileSet>
<directory>resources</directory>
<outputDirectory>/resources</outputDirectory>
<includes>
<include>*.*</include>
</includes>
</fileSet>
</fileSets>
The target directory contain the lib with dependencies but it is located in folder with the artifact name, The resources directory is not being copy at all.
Please advise Thank you