アセンブリ プラグインを使用して依存関係のある jar を構築し、プロジェクトを圧縮しています。次に、zip を nexus にアップロードする必要があります。クリーン インストールが機能し、期待どおりに zip ファイルが生成されます。deploy コマンドが失敗します。
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Analytics Feed Auditor
[INFO] task-segment: [deploy]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[INFO] [assembly:single {execution: jar-with-dependencies}]
[INFO] Processing DependencySet (output=)
[INFO] Building jar: C:\code\imt workspaces\uat-trunk\AnalyticsAudit\target\AnalyticsAudit-1
.0-jar-with-dependencies.jar
[INFO] [assembly:single {execution: RELEASE}]
[INFO] Reading assembly descriptor: dist.xml
[INFO] Building zip: C:\code\imt workspaces\uat-trunk\AnalyticsAudit\target\AnalyticsAudit-1
.0-RELEASE.zip
[INFO] [install:install]
[INFO] Installing C:\code\imt workspaces\uat-trunk\AnalyticsAudit\target\AnalyticsAudit-1.0.
jar to C:\SVNRepository\com\dec\gbm\gb\gcf\amg\fo\AnalyticsAudit\1.0\AnalyticsAudit-1.0.jar
[INFO] Installing C:\code\imt workspaces\uat-trunk\AnalyticsAudit\target\AnalyticsAudit-1.0-
jar-with-dependencies.jar to C:\SVNRepository\com\dec\gbm\gb\gcf\amg\fo\AnalyticsAudit\1.0\Analytic
sAudit-1.0-jar-with-dependencies.jar
[INFO] Installing C:\code\imt workspaces\uat-trunk\AnalyticsAudit\target\AnalyticsAudit-1.0-
RELEASE.zip to C:\SVNRepository\com\dec\gbm\gb\gcf\amg\fo\AnalyticsAudit\1.0\AnalyticsAudit-1.0-REL
EASE.zip
[INFO] [deploy:deploy]
altDeploymentRepository = null
Uploading: https://dsnexus.uk.hibm.dec:8081/nexus/content/repositories/releases/com/dec/gbm/gb/gcf
/amg/fo/AnalyticsAudit/1.0/AnalyticsAudit-1.0.jar
6K uploaded
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error deploying artifact: Failed to transfer file: https://dsnexus.uk.hibm.dec:8081/nexus/co
ntent/repositories/releases/com/dec/gbm/gb/gcf/amg/fo/AnalyticsAudit/1.0/AnalyticsAudit-1.0.jar. Re
turn code is: 400
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 seconds
[INFO] Finished at: Fri Aug 09 15:58:22 BST 2013
[INFO] Final Memory: 14M/35M
[INFO] ------------------------------------------------------------------------
ここでいくつかの問題があります。まず、デフォルトのファイル名ではなく、カスタムの ZIP ファイル名が必要です。次に、JAR ではなく ZIP ファイルのみを Nexus にデプロイする必要があります。第三に、デプロイが現在の状態で機能しないのはなぜですか? 最後に、wget を使用して nexus から最新のリリースを自動的にダウンロードする方法を教えてください。
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project ....>
<modelVersion>4.0.0</modelVersion>
<groupId>com.dec.gbm.gb.gcf.amg.fo</groupId>
<artifactId>AnalyticsAudit</artifactId>
<version>1.0</version>
<name>Analytics Feed Auditor</name>
<description>Analytics Feed Auditor</description>
<packaging>jar</packaging>
<distributionManagement>
<repository>
<id>releases</id>
<name>Internal Releases</name>
<url>...</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Internal Snapshots</name>
<url>...</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>releases</id>
<name>Nexus Repository</name>
<url>...</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>releases</id>
<name>Nexus Repository</name>
<url>...</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<properties>
<project.build.sourceEncoding>Cp1252</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.vicar</groupId>
<artifactId>vicar</artifactId>
<version>3.6</version>
<scope>system</scope>
<systemPath>
${project.basedir}/lib/vicar-3.6.jar
</systemPath>
</dependency>
<dependency>...
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>
jar-with-dependencies
</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>
lib/
</classpathPrefix>
<mainClass>
com.dec.gbm.gb.gcf.amg.fo.AnalyticsAuditor
</mainClass>
</manifest>
</archive>
</configuration>
</execution>
<execution>
<id>RELEASE</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>dist.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
dist.xml
<assembly>
<id>RELEASE</id>
<formats>
<format>zip</format>
</formats>
<files>
<file>
<source>
target/${project.artifactId}-${project.version}-jar-with-dependencies.jar
</source>
<outputDirectory>lib</outputDirectory>
</file>
<file>
<source>${project.basedir}/bin/AnalyticsAudit.cmd</source>
<outputDirectory />
</file>
<file>
<source>
${project.basedir}/resources/analytics_audit.properties
</source>
<outputDirectory>resources</outputDirectory>
</file>
<file>
<source>${project.basedir}/lib/vicar-3.6.jar</source>
<outputDirectory>lib</outputDirectory>
</file>
</files>
私はこれにあまりにも長い時間を費やし、やりすぎました。どんな助けにもとても感謝しています。