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>
Jean-Rémy Revy
  • 5,607
  • 3
  • 39
  • 65
gaffcz
  • 3,469
  • 14
  • 68
  • 108
  • 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. – Michał Kalinowski Apr 11 '12 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.. – gaffcz Apr 11 '12 at 13:15
  • The second and fourth message are related to m2e - see http://stackoverflow.com/questions/6352208/. – Björn Pollex Apr 12 '12 at 06:24

1 Answers1

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.

Michał Kalinowski
  • 16,925
  • 5
  • 35
  • 48
  • Thanks, i'll try it. I thought, that it will generate my pom.xml file automatically, without work :-) – gaffcz Apr 11 '12 at 14:23