Maven 那些破事
deploy 只上传了pom
晚上输命令,打算打包上传到本地库里,然后去服务器上部署新版本
mvn clean package deploy
结果看着mvn的build过程只是上传了pom,去库服务器看了也只有pom文件,这让人相当懊恼。翻来覆去,突然看到项目pom文件里
<groupId>X-Pro</groupId>
<artifactId>Y-Service</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
packaging一项怎么变成了pom了,原来好像是jar还是war这类的,尼玛今天intellij一直抽风一天到晚把Java版本调成1.5的,居然把pom也换掉了。。。,当然也可能是自己乱改配置什么时候变掉了。然后改回jar,在mvn命令提示:
$ mvn clean package deploy -U
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project XXXXXXX:YYYYYYY:1.0-SNAPSHOT (/Users/hegaofeng/IdeaProjects/XXXXXXX/pom.xml) has 1 error
[ERROR] 'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging. @ line 8, column 13
[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
想起来今天把几个其他maven工程当做这个工程的module加到pom里,这个在工程mvn package时会去相应的编译更新子模块,想不到还有这限制,只生成pom不生成jar还搞个毛线啊,算了不用这个功能了。当然可定有高大上的用法,不过暂时先生成jar再说。