4

I'm trying to start with maven using m2e plugin for eclipse. But if I try to change existing project to Maven project (Configure/Convert to Maven Project), result is:

Multiple annotations found at this line:

  • Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 from/to central (http://repo1.maven.org/maven2): Connect times out
  • Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (execution: default-compile, phase: compile)
  • CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from/to central (http://repo1.maven.org/maven2): Connect times out
  • Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile (execution: default-testCompile, phase: test-compile)

I'm not behind the firewall (I was able to download and install m2e using eclipse installation interface).

Where could be the problem?

UPDATE (generated pom.xml):

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>PRJ</groupId> <artifactId>PRJ</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> </project> 
3
  • Can you paste the generated POM (I assume there is one)? Another thing: try to regenerate Eclipse project file by doing Maven -> Update Project Configuration... on the project. Commented Apr 11, 2012 at 13:07
  • Please see my updated question. Almost nothing is generated. And tha Update Project Configuration doesn't help. But in each classes of project are lost all the imports from WEB=INF\lib folder now.. Commented Apr 11, 2012 at 13:15
  • The second and fourth message are related to m2e - see stackoverflow.com/questions/6352208. Commented Apr 12, 2012 at 6:24

1 Answer 1

4

You should actually remove all libs you have in WEB-INF/lib directory and add adequate dependency declarations in the POM. WEB-INF directory itself (and other web resources) should stay in src/main/webapp. If you have some non-Java files in WEB-INF/classes, move them into src/main/resources. After all, do Maven build on console by mvn clean package and tell if it works. It should. Then regenerate Eclipse project files by Maven -> Update Project Configuration....

I don't believe in such tools for automagic migration of freestyle (mostly Ant) projects into Maven. As I see, it does nothing more that generate almost plain POM.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, i'll try it. I thought, that it will generate my pom.xml file automatically, without work :-)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.