Tôi đã giải quyết isue tương tự bằng lệnh exec-maven-plugin với hai lần thực hiện, một là zip directorys và triển khai khác với bộ phân loại bin vào kho lưu trữ trong trường hợp của tôi cho bên thứ ba. Vì vậy, tôi đã lưu tất cả các quyền unix trong tệp zip.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>1</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>zip</executable>
<workingDirectory>${basedir}</workingDirectory>
<arguments>
<argument>-r</argument>
<argument>target/com.example.test.ext.zip</argument>
<argument>Out</argument>
<argument>-x</argument>
<argument>*.svn*</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>2</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>mvn</executable>
<workingDirectory>${basedir}/target</workingDirectory>
<arguments>
<argument>deploy:deploy-file</argument>
<argument>-Dfile=com.example.test.ext.zip</argument>
<argument>-Dclassifier=bin</argument>
<argument>-DgroupId=com.example</argument>
<argument>-DartifactId=test</argument>
<argument>-Dversion=1.0</argument>
<argument>-Dpackaging=zip</argument>
<argument>-DrepositoryId=releases</argument>
<argument>-Durl=http://nexus..../nexus/content/repositories/thirdparty
</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
Nếu bạn sử dụng kết quả như một depenency không quên "bin" phân loại:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>unpack1</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.example</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<classifier>bin</classifier>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>output</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
Ngoài ra điều này trở nên lộn xộn hơn khi bạn cần phải xem xét cửa sổ, thêm hồ sơ v.v. –