0

I have installed m2eclipse plugin. I tried to convert a java project into a maven project.Here is my 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"> <groupId>com.test</groupId> <artifactId>SpringExample</artifactId> <version>1.0.0</version> <modelVersion>4.0.0</modelVersion> <packaging>jar</packaging> <dependencies> <dependency> <artifactId>commons-lang</artifactId> <groupId>commons-lang</groupId> <version>2.1</version> </dependency> </dependencies> </project>

When I clicked on configure and converted it into maven project , I found out that 2 folders have been generated bin & target and all the class files are in bin folder, target folder is empty & jar was not created. This is the first time I'm trying to use maven and what I understand is that there should have been 2 folders generated src and target. I can't figure out what went wrong(I did not get any error). I am using eclipse juno ,I have installed m2e version 1.3.1.x

1
  • Update your m2e installation cause current version is 1.6 Furthermore it would suggest to get an more up to date of Eclipse like Luna etc. Commented Jan 28, 2015 at 7:16

2 Answers 2

1

I would recommend that you read Maven in 5 minutes. Converting the project will only generate the pom ("This wizard creates a new POM (pom.xml) descriptor for Maven.").

If you want to generate an project with the folder structure you have to use an maven archetype.

Example:

mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId=com.test -DartifactId=SpringExample -Dversion=1.0.0 -Dpackaging=jar -DinteractiveMode=false 
Sign up to request clarification or add additional context in comments.

Comments

0

You have to put your code under src/main/java. Tests should be under src/test/java. Your output is in target directory. Bin is generated by Eclipse not maven. More about directory structure here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.