maven发布jar包时就最后的controller没有通过
[INFO] parent ............................................. SUCCESS [ 1.990 s]
[INFO] maven_pojo ......................................... SUCCESS [ 2.011 s]
[INFO] maven_dao .......................................... SUCCESS [ 0.958 s]
[INFO] maven_service ...................................... SUCCESS [ 0.823 s]
[INFO] maven_web Maven Webapp ............................. FAILURE [ 1.247 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
报以下错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project maven_web: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
主要原因是pom配置错误
1.在父工程的pom中没有配置以下代码
<distributionManagement>
<repository>
<id>xxx-release</id>
<url>http://localhost:8081/repository/xxx-release/</url>
</repository>
<snapshotRepository>
<id>xxx-snapshots</id>
<url>http://localhost:8081/repository/xxx-snapshots/</url>
</snapshotRepository>
</distributionManagement>
2.我的报错在maven_web中。仔细检查过后发现是没有在子工程maven_web的pom中配置对应父工程的代码
<!--指定父工程是那个-->
<parent>
<artifactId>parent</artifactId>
<groupId>org.example</groupId>
<version>1.0-SNAPSHOT</version>
</parent>