maven常见错误

  1. 错误如下: ‘packaging’ with value ‘’ is invalid. Aggregator projects require ‘pom’ as packaging. @ line 11, column 16
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging:  @ line 11, column 16
[ERROR] 'packaging' is missing. @ line 11, column 16
[ERROR] 'packaging' with value '' is invalid. Aggregator projects require 'pom' as packaging. @ line 11, column 16
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.atguigu.springcloud:microsevicecloud:0.0.1-SNAPSHOT (/Users/wyshown/Study/microsevicecloud/pom.xml) has 3 errors
[ERROR]     Unknown packaging:  @ line 11, column 16
[ERROR]     'packaging' is missing. @ line 11, column 16
[ERROR]     'packaging' with value '' is invalid. Aggregator projects require 'pom' as packaging. @ line 11, column 16
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

代码如下:



    4.0.0

    
    com.atguigu.springcloud
    
    microsevicecloud
    1.0-SNAPSHOT
    pom

原因如下:
因为maven工程, 当不设置packaging指定参数的话, packaging的默认值为jar, 而pom的父类工程不能为jar, 所有会出此错误
解决方法,
查看父类的pom文件 是否有pom 如果无则添加pom

2.Non-resolvable parent POM for com.atguigu.springcloud:microsevicecloud-api:1.0-SNAPSHOT: Could not find artifact com.atguigu.springcloud:microsevicecloud:pom:0.0.1-SNAPSHOT and ‘parent.relativePath’ points at wrong local POM @ line 8, column 13

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.atguigu.springcloud:microsevicecloud-api:1.0-SNAPSHOT: Could not find artifact com.atguigu.springcloud:microsevicecloud:pom:0.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 8, column 13
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.atguigu.springcloud:microsevicecloud-api:1.0-SNAPSHOT (/Users/wyshown/Study/microsevicecloud-api/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.atguigu.springcloud:microsevicecloud-api:1.0-SNAPSHOT: Could not find artifact com.atguigu.springcloud:microsevicecloud:pom:0.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 8, column 13 -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

Process finished with exit code 1

代码如下:


    
    com.atguigu.springcloud
    
    microsevicecloud
    0.0.1-SNAPSHOT

更改后如下:


    
    com.atguigu.springcloud
    
    microsevicecloud
    0.0.1-SNAPSHOT
    ../microsevicecloud/pom.xml

你可能感兴趣的:(服务器环境)