gaffcz
gaffcz

Reputation: 3479

m2e: convert project to maven project

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:

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>

Upvotes: 4

Views: 6931

Answers (1)

Michał Kalinowski
Michał Kalinowski

Reputation: 17933

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.

Upvotes: 4

Related Questions