Project error when creating MAVEN project
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not being resolved:failed to Rea D Artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6:could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to Nexus (http://localhost:8080/nexus-2.7.0-06/ content/groups/public/): Connect to localhost:8080 [localhost/127.0.0.1, Localhost/0:0:0:0:0:0:0:1] failed: Connection Refused:connect [Help 1]
Method One: There are many people on the internet who say the following methods are feasible
1. Open the config in the Maven root directory and open settings.xml to find the local warehouse location <localrepository>f:/taotao/repository</localrepository >
2. Open the F:\taotao\repository\org\apache\maven\plugins and empty the plugins inside.
3. Right-click Maven Project->run As->maven Install
Method Two:
1. Open the config in the Maven root directory and open settings.xml add
<mirror>
<id>Central</id>
<url>http://repo1.maven.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
2. Open the F:\taotao\repository\org\apache\maven\plugins and empty the plugins inside.
3. Right-click Maven Project->run As->maven Install, this will download most of the plugins, but the following problems occur
Failed to execute goal Org.apache.maven.plugins:maven-war-plugin:2.2:war (Default-war) on project Itcast-usemanage: Error assembling War:webxml attribute is required (or pre-existing web-inf/web.xml if executing in update mode), [He LP 1]
4-1. With Web. XML in the project, add Maven-war-plugin configuration to the Pom.xml <build> node
<plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> < artifactid>maven-war-plugin</artifactid> <version>3.0.0</version> < configuration> <webResources> <resource> <directory>webcontent</directory > </resource> </webResources> </configuration> </plugin>
4-2. With Web. XML in the project, add Maven-war-plugin configuration to the Pom.xml <build> node
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>
3.0
.
0
</version>
<configuration>
<failOnMissingWebXml>
false
</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
5. Right-click Maven Project->run As->maven Install, successfully solve the problem
Method Three:
1.windows->preferences->maven->lifecycle mapping Find the mapping file location inside
Address: D:/itcast-workspace/.metadata/.plugins/org.eclipse.m2e.core/lifecycle-mapping-metadata.xml
When we opened it, we found that we couldn't find the path.
2. Open the root directory of eclipses open plugins find a package named Org.eclipse.m2e.lifecyclemapping.defaults_1.5.0.20140606-0033.jar
3. Unzip the jar package in step 2 to the mapping file location in step 1 and open the Lifecycle-mapping-metadata.xml
4. Add the configuration if Maven-compiler-plugin is missing
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<versionrange>[2.5.1,) </versionRange>
<goals>
<goal>testCompile</goal>
<goal>compile</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore/>
</action>
</pluginExecution>
5.windows->preferences->maven update MAVEN projects on startup Hook
6. Right-click Project->maven->update Projects
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6