我有一个具有以下层次结构的多模块maven项目,希望在mvn构建和curl之后创建一个zip,或者将其上载到一个私有存储库。我正在使用maven汇编插件,但它不包括所需的目录。你能给点建议吗?
|--subproject1
|--src/main/..
|--resoruces/..
|target/..
|pom.xml
|--subproject2
|--src/main/..
|--resoruces/..
|pom.xml
pom.xml```
content of zip.xml
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>project</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<!--<fileSet></fileSet>-->
<fileSets>
<fileSet>
<directory>${project.basedir}/subproject1</directory>
<outputDirectory></outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
<excludes>
<exclude>**/*.log</exclude>
</excludes>
</fileSet>
</fileSets>
<files>
<file>
<source> ${project.basedir}/pom.xml</source>
<outputDirectory>/</outputDirectory>
</file>
</files>
</assembly>
below plugin is added in pom.xml of subproject1
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>true</appendAssemblyId>
<descriptors>
<descriptor>zip.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
我想用subproject1创建一个包含src、resources和target文件夹的zip。请帮忙。
暂无答案!
目前还没有任何答案,快来回答吧!