1

어셈블리 플러그인을 사용하여 종속성이있는 jar를 빌드 한 다음 프로젝트를 압축합니다. 그런 다음 zip을 넥서스에 업로드해야합니다. 새로 설치하면 정상적으로 zip 파일이 생성되고 생성됩니다. 배포 명령이 실패합니다.Maven 어셈블리 ZIP를 넥서스에 배포

[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 파일 이름이 아닌 사용자 지정 ZIP 파일 이름이 필요합니다. 두 번째로는 ZIP 파일 만 병이 아닌 Nexus에 배포해야합니다. 셋째, 배포가 현재 상태에서 작동하지 않는 이유는 무엇입니까? 마지막으로 wget을 사용하여 넥서스에서 자동으로 마지막 릴리즈를 다운로드 할 수있는 방법을 알려주시겠습니까?

의 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> 

. 어떤 도움을 주셔서 감사합니다.

+0

답변 없음? 아무도 전에 이걸 시도한거야? – user1323670

답변

2

기본적으로 메이븐 어셈블리 플러그인을 사용하여 zip을 배포 할 수 없습니다. 조립품은 포장의 일부이며 나중에 배치됩니다. 이 링크가 유용한 지 확인

Deploying assembly package with maven-release-plugin

또는

당신은 받는다는 빌드 - 도우미 - 플러그인에게 zip 또는 타르 파일을 배포하기 위해이 플러그인을 사용할 수 있습니다

0

넥서스 (400 개) 상태를 반환 즉, 특정 저장소에 업로드 할 수없는 이슈를 업로드하는 것입니다. 예를 들어 스냅 샷을 릴리스 저장소에 업로드하려고하는 경우입니다.

"mvn deploy"를 사용하여 스냅 샷으로 배포하려고합니다. "mvn release : prepare release : perform"를 사용해 "stable"버전을 "releases"저장소로 릴리스하십시오. 400 상태 응답을 더 이상받지 못하게해야합니다.

0
 <!--Make it a fat jar--> 
     <plugin> 
      <artifactId>maven-assembly-plugin</artifactId> 
      <configuration> 
       <descriptorRefs> 
        <descriptorRef>jar-with-dependencies</descriptorRef> 
       </descriptorRefs> 
      </configuration> 
      <executions> 
       <execution> 
        <id>make-assembly</id> <!--this is used for inheritance merges--> 
        <phase>package</phase> <!--bind to the packaging phase--> 
        <goals> 
         <goal>single</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin>