あなたのzip
ファイルにどのような分類子を使用するかを決定します。これは、引数として、sample
としましょう。あなたのプロジェクトで
はファイルassembly/sample.xml
を作成するには、このようなものでassembly/sample.xml
に入力します。
<?xml version="1.0" encoding="UTF-8"?>
<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>sample</id>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<outputDirectory>/</outputDirectory>
<directory>some/directory/in/your/project</directory>
</fileSet>
</fileSets>
<!-- use this section if you want to package dependencies -->
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<excludes>
<exclude>*:pom</exclude>
</excludes>
<useStrictFiltering>true</useStrictFiltering>
<useProjectArtifact>false</useProjectArtifact>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
は、それが作成する必要があり、結果としてあなたのポンポンのbuild
セクション
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>create-distribution</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>assembly/sample.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
にこれを追加し、 you-project-name-VERSION-sample.zip
をインストールしてください。
私はあなたがSonatypeのMavenの本からアセンブリの章を読むことをお勧め: https://books.sonatype.com/mvnref-book/reference/assemblies.html
また、組立フォーマット仕様をお読みください。http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html
ここでは「クラシファイア」なしで行うことができます:https://stackoverflow.com/questions/25078028/how-to-create-zip-target-instead-of-jar-in-maven – Adam