0
私のプロジェクトでは、ZIPファイルにパックしてNexusリポジトリにアップロードするファイルがいくつかあります。Mavenを使ってNexusにZIPファイルをアップロードし、NexusでPOMアーティファクトを作成しないようにするにはどうすればいいですか?
私は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>
、私はネクサスで見たときに私は2つのアーティファクトを参照してください。
を<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アーティファクトを取り除くにはどうすればよいですか?それとも、必要なシナリオがありますか?
まず、あなたのpomのfinalName設定はNexusへのアップロードには役に立たないです。そしてあなたはポンのアーティファクトを防ぐことができないので、それは必要です。そして、あなたがこの種の依存性を使用しているすべての時間、ポン・アーティファクトがアーティファクトを識別するために使用されます。スニペットを貼り付けるのは依存関係としての使用にすぎませんが、このアーティファクトの種類を分析するために必要なpomアーティファクトが必要です。これには他の依存関係がある場合(この場合はそうではありません)。 – khmarbaise