在我的项目中,我将几个文件打包成ZIP文件并将其上传到Nexus存储库。
我使用Maven程序集插件实现了两个操作:
的pom.xml
<groupId>com.ddd.tools</groupId>
<artifactId>mytool</artifactId>
<version>2.1.0</version>
<packaging>pom</packaging>
<name>Tool</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<!-- File bin.xml saves information about which files are to be included to the ZIP archive. -->
<descriptor>bin.xml</descriptor>
<finalName>${pom.artifactId}-${pom.version}</finalName>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
BIN.XML
<assembly ...>
<id>bin</id>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>src/release</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>Tool.exe</include>
</includes>
</fileSet>
</fileSets>
</assembly>
现在,当我查看Nexus时,我看到了两个文物:
<dependency>
<groupId>com.ddd.tools</groupId>
<artifactId>mytool</artifactId>
<version>2.1.0</version>
<type>pom</type>
</dependency>
和
<dependency>
<groupId>com.ddd.tools</groupId>
<artifactId>mytool</artifactId>
<version>2.1.0</version>
<classifier>bin</classifier>
<type>zip</type>
</dependency>
我只对后一种ZIP工件感兴趣,因为它是我上传的ZIP文件。
如何摆脱Nexus的第一个POM神器?或者有任何我需要的场景吗?