2014-01-17 12 views
6

私のプロジェクトをビルドするためにmavenを使用するとエラーが発生します。 maven-アセンブリのプラグインを::2.2.1:アセンブリ (メイクアセンブリ)プロジェクトnewstartアプリ-ithelp上 は私はmavenのビルドエラーの失敗を解決できません

目標 org.apache.maven.pluginsの実行に失敗しましたあなたの助けをありがとう:実行 ゴールの組み立て org.apache.maven.plugins:maven-assembly-plugin:2.2.1:assembly failed: {null:null:null:jar}の場合、groupIdは空にすることはできません。原因: :ゴールを実行する - org.apache.maven.plugins:maven-assembly-plugin:2.2.1:assembly failed: アーティファクトの場合{null:null:null:jar}:groupIdを空にすることはできません。スタック トレース:org.apache.maven.lifecycle.LifecycleExecutionException: ゴールを実行できませんでした org.apache.maven.plugins:maven-assembly-plugin:2.2.1:プロジェクトnewstart-appにアセンブリ (make-assembly) -ithelp:Execution ゴールの組み立て org.apache.maven.plugins:maven-assembly-plugin:2.2.1:アセンブリに失敗しました: アーティファクト{null:null:null:jar}:groupIdは空にできません。

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
<parent> 
    <groupId>com.feinno.app</groupId> 
    <artifactId>root-pom</artifactId> 
    <version>1.0.0</version> 
</parent> 
<modelVersion>4.0.0</modelVersion> 

<groupId>newstart.app</groupId> 
<artifactId>newstart-app-ithelp</artifactId> 
<version>0.0.1-SNAPSHOT</version> 
<packaging>jar</packaging> 

<name>newstart-app-ithelp</name> 
<url>http://maven.apache.org</url> 

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
</properties> 
<build> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-assembly-plugin</artifactId> 
      <version>2.2.1</version> 
      <configuration> 
       <appendAssemblyId>false</appendAssemblyId> 
       <descriptorRefs> 
        <descriptorRef>jar-with-dependencies</descriptorRef> 
       </descriptorRefs> 
       <archive> 
        <manifest> 
         <mainClass>com.newstart.app.ithelp.ITHelpBean</mainClass> 
        </manifest> 
       </archive> 
      </configuration> 
      <executions> 
       <execution> 
        <id>make-assembly</id> 
        <phase>package</phase> 
        <goals> 
         <goal>assembly</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>2.3.2</version> 
      <configuration> 
       <verbose>true</verbose> 
       <fork>true</fork> 
       <source>1.6</source> 
       <target>1.6</target> 
      </configuration> 
     </plugin> 

     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <configuration> 
       <skip>true</skip> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 
<dependencies> 
    <dependency> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-resources-plugin</artifactId> 
     <version>2.4.3</version> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>3.8.1</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>log4j</groupId> 
     <artifactId>log4j</artifactId> 
     <version>1.2.16</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.httpcomponents</groupId> 
     <artifactId>httpclient</artifactId> 
     <version>4.1.2</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.httpcomponents</groupId> 
     <artifactId>httpmime</artifactId> 
     <version>4.1.2</version> 
    </dependency> 
    <dependency> 
     <groupId>com.google.code.gson</groupId> 
     <artifactId>gson</artifactId> 
     <version>2.0</version> 
    </dependency> 
    <dependency> 
     <groupId>com.feinno.app</groupId> 
     <artifactId>feinno-app-common</artifactId> 
     <version>0.0.1-SNAPSHOT</version> 
    </dependency> 
    <dependency> 
     <groupId>org.quartz-scheduler</groupId> 
     <artifactId>quartz</artifactId> 
     <version>2.2.0</version> 
    </dependency> 
    <dependency> 
     <groupId>mysql</groupId> 
     <artifactId>mysql-connector-java</artifactId> 
     <version>5.1.24</version> 
    </dependency> 
    <dependency> 
     <groupId>com.alibaba</groupId> 
     <artifactId>druid</artifactId> 
     <version>0.2.9</version> 
    </dependency> 
    <dependency> 
     <groupId>spring-aop</groupId> 
     <artifactId>spring-aop</artifactId> 
     <version>3.2.3</version> 
    </dependency> 
    <dependency> 
     <groupId>spring-beans</groupId> 
     <artifactId>spring-beans</artifactId> 
     <version>3.2.3</version> 
    </dependency> 
    <dependency> 
     <groupId>spring-context</groupId> 
     <artifactId>spring-context</artifactId> 
     <version>3.2.3</version> 
    </dependency> 
    <dependency> 
     <groupId>spring-core</groupId> 
     <artifactId>spring-core</artifactId> 
     <version>3.2.3</version> 
    </dependency> 
    <dependency> 
     <groupId>spring-jdbc</groupId> 
     <artifactId>spring-jdbc</artifactId> 
     <version>3.2.3</version> 
    </dependency> 
    <dependency> 
     <groupId>spring-tx</groupId> 
     <artifactId>spring-tx</artifactId> 
     <version>3.2.3</version> 
    </dependency> 
    <dependency> 
     <groupId>spring-expression</groupId> 
     <artifactId>spring-expression</artifactId> 
     <version>3.2.3</version> 
    </dependency> 
    <dependency> 
     <groupId>IKAnalyzer</groupId> 
     <artifactId>IKAnalyzer</artifactId> 
     <version>6</version> 
    </dependency> 
    <dependency> 
     <groupId>commons-logging</groupId> 
     <artifactId>commons-logging</artifactId> 
     <version>1.1.2</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.lucene</groupId> 
     <artifactId>lucene-core</artifactId> 
     <version>3.6.0</version> 
    </dependency> 
    <dependency> 
     <groupId>net.sf.ehcache</groupId> 
     <artifactId>ehcache-core</artifactId> 
     <version>2.6.0</version> 
    </dependency> 
    <dependency> 
     <groupId>linq4j</groupId> 
     <artifactId>linq4j</artifactId> 
     <version>1.0</version> 
    </dependency> 
</dependencies> 
<distributionManagement> 
    <snapshotRepository> 
     <id>snapshots</id> 
     <url>http://10.10.208.92:8081/content/repositories/snapshots</url> 
    </snapshotRepository> 
</distributionManagement> 

+5

それは、groupIdを空にすることはできません。 'pom.xml'を投稿してください –

+0

あなたは何を正確にしようとしていましたか?どのコマンド?また、あなたはエラーメッセージを読んだのですか? –

+0

mvn clean installを実行していますか? – vikingsteve

答えて

17

私は地元の.m2/repositoryフォルダを削除することによって、この問題を修正しました。ビルドは今成功している。

+1

私はこのような不自然なエラーを嫌い...これも私のために働いた。ウィンドウを走らせていて、これを見つける場所がわからない場合は、 '%username%\。m2'に行きます。 –

+0

これは私のために働いた。私の内部ネクサスの問題のため、私のmvnビルドはチェックサムエラーで早く失敗しました。この失敗したビルドの後、私は "目標のorg.apache.maven.plugins:maven-assembly-plugin:2.2.1:assembly failed:アーティファクト{null:null:null:jar}の実行Make-assemblyを取得しました。空でなければならない。エラー。 –

1

最近同じ問題が発生しました。私は、アセンブリのプラグインから持っているものすべてです

[DEBUG] Resolving project dependencies transitively. 
[DEBUG] com.g.....0.4-SNAPSHOT (selected for null) 
[DEBUG]   org.springframework:spring-expression:jar:3.1.4.RELEASE:compile (selected for compile) 
[DEBUG]   org.springframework:spring-asm:jar:3.1.4.RELEASE:compile (selected for compile) 
[DEBUG]   trove:trove:jar:1.0.2:compile (selected for compile) 
[INFO] ------------------------------------------------------------------------ 
[INFO] Reactor Summary: 
.... 
[INFO] p.....mo ....................................... FAILURE [57.144s] 
[INFO] BUILD FAILURE 

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.5.4:single (full) on project p...o: Execution full of goal org.apache.maven.plugins:maven-assembly-plugin:2.5.4:single failed: For artifact {null:null:null:jar}: The groupId cannot be empty. -> [Help 1] 

を:私は、そのアセンブリ-プラグインが依存関係を持つ/レポートのエラーを伝播しませんになります。例えば。コンパイラが壊れたものについて警告:あなたはこのトラブルで立ち往生してきた場合

[WARNING] error reading /var/lib/jenkins/...org/hyperic/sigar/1.6.3.82/sigar-1.6.3.82.jar; error in opening zip file 
[WARNING] error reading /var/lib/jenkins/.../org/hyperic/sigar/1.6.3.82/sigar-1.6.3.82.jar; error in opening zip file 

このように、依存関係のトラブルシューティングを行うにはmvn dependency:treeを呼び出します。

+0

これはCodehausを停止することによって発生します。https://www.codehaus.org/termination.html – mkhludnev

+0

ありがとうございます。あなたのソリューションはまさに私の問題でした。今私は、そうすることにエネルギーを費やすことを選択すれば、[マジブリー664](https://issues.apache.org/jira/browse/MASSEMBLY-664)を再現できると私は十分に知っています。 –

5

私には別の解決策があります。私は<version>いかなるせずにjarファイルため<dependencyManagement>エントリを持っていたPOMを持っていたし、それが<version>と瓶ため<dependencies>エントリを持っていました。さらに、親POMは<dependencyManagement>のエントリと同じ<version>を持っていました。明らかにこれはMaven(3.3)を混乱させました。ビルドはうまくいきましたが、パッケージ化はできませんでした。

修正:子POMの<dependencyManagement>エントリを削除し、子POMの<dependencies>エントリから<version>を削除します。コードで

は、ここに壊れた状況です:

Parent pom.xml: 
<dependencyManagement> 
    <dependencies> 
     <dependency> 
      <groupId>org.apache.httpcomponents</groupId> 
      <artifactId>httpclient</artifactId> 
      <version>${httpclient.version}</version> 
     </dependency> 
    </dependencies> 
</dependencyManagement> 

Child pom.xml: 
<dependencyManagement> 
    <dependencies> 
     <dependency> 
      <groupId>org.apache.httpcomponents</groupId> 
      <artifactId>httpclient</artifactId> 
     </dependency> 
    </dependencies> 
</dependencyManagement> 
... 
<dependencies> 
    <dependency> 
     <groupId>org.apache.httpcomponents</groupId> 
     <artifactId>httpclient</artifactId> 
     <version>${httpclient.version}</version> 
    </dependency> 
</dependencies> 

ポストフィックス:あなたのMavenを見れば、親POMが同じで、子ポンポンはちょうどこの

<dependencies> 
    <dependency> 
     <groupId>org.apache.httpcomponents</groupId> 
     <artifactId>httpclient</artifactId> 
    </dependency> 
</dependencies> 
1

を持つ出力を構築し、言ういくつかの警告があるはずです。pomが無効である場合、推移的な依存関係(存在する場合)は利用できません。これらのポムに対応するすべての成果物を削除して再構築すると、リポジトリ全体を削除する必要はありません。

関連する問題