解决:single failed: For artifact {null:null:null:jar}: The groupId cannot be empty. 把工程依赖的jar包打到入jar中
生活随笔
收集整理的這篇文章主要介紹了
解决:single failed: For artifact {null:null:null:jar}: The groupId cannot be empty. 把工程依赖的jar包打到入jar中
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
前些天發現了一個巨牛的人工智能學習網站,通俗易懂,風趣幽默,忍不住分享一下給大家。點擊跳轉到教程。
1. 執行 mvn clean install 報錯:
Execution make-assembly of goal org.apache.maven.plugins:maven-assembly-plugin:2.4.1:single failed: For artifact {null:null:null:jar}: The groupId cannot be empty.2. 我只是想把工程依賴的jar包打到 最后的jar包中。
pom 中加上配置,會生成2個 jar ,用帶有依賴的那個 jar 就行。( 如下文中的xxx-0.0.1-SNAPSHOT-jar-with-dependencies.jar )
<plugin><artifactId>maven-assembly-plugin</artifactId> <version>3.3.0</version><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>singles</goal></goals></execution></executions></plugin>3. 特別注意:版本一定要是3.3.0,或者查官網找最新文檔中的版本。我之前用的是2.4.1,就一直報如題的錯。
只是改為官方文檔上的版本就可。文檔地址:http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
生成的jar 如:
總結
以上是生活随笔為你收集整理的解决:single failed: For artifact {null:null:null:jar}: The groupId cannot be empty. 把工程依赖的jar包打到入jar中的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: JSON数据格式详解
- 下一篇: C# 创建一个简单的WebApi项目