1. 程式人生 > >Maven項目中遇到的奇葩問題(續)

Maven項目中遇到的奇葩問題(續)

圖片 周期 required pan maven項目 require err fig ++

場景描寫敘述

開發項目搞環境是一個很蛋疼的問題。總是會遇到各種奇葩的問題,上一篇文章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項目中遇到的奇葩問題(續)