2013年7月30日星期二

Eclipse Maven project suggest a lack of running maven

manually create a Maven project (command line under normal operation) into Eclipse, run-time prompts an error message such :
[ERROR] Plugin org.apache.maven.plugins: maven-resources-plugin: 2.4.3 or one of its dependencies could not be resolved :
Failed to collect dependencies for org.apache.maven.plugins: maven-resources-plugin: jar: 2.4.3

troubleshooting steps:

1, in the project's pom.xml file to add a dependency , as follows:

    <dependency> 
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
</dependency>

2, at the command line run mvn install

If you execute properly should be in {user.home} \. m2 \ repository \ org \ apache \ maven \ plugins \ maven-resources-plugin \ 2.4.3 directory Down Under see maven-resources-plugin-2.4.3.jar file

Note:

a, run mvn install When the item you want to run under the main folder, that same directory and pom.xml

b, run down and 2.4.3 may not have this directory, but there will be a maven-resources-plugin-2.4.3.jar file. Because the author under the local repository, maven-resources-plugin has several different versions.

3, refresh the project ( Right-engineering select Refresh entry)

4, refresh maven configuration

Right project node, choose Maven4MyEclipse - Update Project Configuration

If that does not work, click on the Eclipse toolbar Window < span style = "word-wrap: break-word; font-family: 'Microsoft YaHei'; font-size: 14px;"> - Preferences , in the left column, click MyEclipse - Maven4MyEclipse , on the right, to find Offline This one will be in front of ? removed, as shown.

and then repeat the above steps 3 and 4.

PS similar problems can be solved like! Adding the pom.xml dependent libraries into the desired one.

没有评论:

发表评论