Maven项目中遇到的奇葩问题(续)

Posted RelievedAbility

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Maven项目中遇到的奇葩问题(续)相关的知识,希望对你有一定的参考价值。

场景描述

开发项目搞环境是一个非常蛋疼的问题,总是会遇到各种奇葩的问题,上一篇文章http://blog.csdn.net/gao36951/article/details/50955526中遇到的问题,本以为解决了就OK了,但是结果却不尽人意。解决了一个问题,又来了另外一个问题如下图
这里写图片描述
查看项目的Maven生命周期如下
这里写图片描述
错误内容粘贴如下

Multiple annotations found at this line:
    - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (execution: default-compile, phase: compile)
    - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.5.1:testCompile (execution: default-testCompile, phase: test-compile)
    - CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.5.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for 
     org.apache.maven.plugins:maven-compiler-plugin:jar:2.5.1: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 from http://120.52.145.47:443/content/groups/public/ was 
     cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-
     plugin:pom:2.5.1 from/to nexus (http://120.52.145.47:443/content/groups/public/): Not authorized by proxy , ReasonPhrase:Proxy Authorization Required.

解决方案

在project中添加如下,然后再看错误没有了,项目的maven生命周期也正常了

<build>
        <finalName>seckill</finalName>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.0</version>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                        <encoding>UTF8</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.4</version>
                    <configuration>
                        <webResources>
                            <resource>
                                <directory>src/main/webapp</directory>
                                <excludes>
                                    <exclude>*.jsp</exclude>
                                </excludes>
                            </resource>
                        </webResources>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

参考:http://www.myexception.cn/open-source/1658207.html

以上是关于Maven项目中遇到的奇葩问题(续)的主要内容,如果未能解决你的问题,请参考以下文章

关于springboot maven项目中的一个奇葩错误的解决方案

部署mavenx项目,无法找到MAVEN管理的包

mavenmaven各种奇葩问题

奇葩问题 eclipse下 maven项目 java Resource报个小红叉,然而里面却没有小红叉

idea使用maven整合ssm框架

项目中遇到的一个奇葩的需求 - 打开网页后浏览器自动全屏