0

Actually, i am making a webproject with maven in command line.

mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.0 -DgroupOd=ar.com -DartifactId=RETOP

then i write mvn -Dwtpversion=2.0 eclipse:eclipse 1) in the project when I import I do not see the folder src / main / java why not?

2) the eclipse not take me M2_REPO variable (in another workspace it works) I have added the variable and the jar.

3) Description Resource Path Location Type Java compiler level does not match the version of the installed Java project facet. PropiedadesArg Unknown Faceted Project Problem (Java Version Mismatch)

thanks

1

1 Answer 1

4

2) the eclipse not take me M2_REPO variable (in another workspace it works) I have added the variable and the jar.

For every workspace, you need to call mvn eclipse:configure-workspace once. This initializes the M2_REPO variable.

3) Description Resource Path Location Type Java compiler level does not match the version of the installed Java project facet. PropiedadesArg Unknown Faceted Project Problem (Java Version Mismatch)

The compiler level is taken from the pom configuration of the maven compiler plugin.

Example (for 1.6 compliance):

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> 

But apart from that: mvn eclipse:eclipse shouldn't be used any more, m2eclipse is the way to go for Eclipse + Maven. It uses an embedded Maven installation to actually run the maven build (or parts of it) in Eclipse, whereas the Maven Eclipse Plugin just configures Eclipse from the outside. Here's a thread were the Maven founders discuss this topic.


Also:

mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.0 -DgroupOd=ar.com -DartifactId=RETOP ^^^^^^^ 

here's a typo, it's groupId, not groupOd


Oh, now I get it. eclipse:eclipse uses the variable MAVEN_REPO, not M2_REPO (M2_REPO is created and maintained by m2eclipse). Anyway, in Eclipse, select Window > Preferences > Java > Build Path > Classpath Variables, add or edit the M2_REPO variable and set it to <path to your home directory>/.m2/repository, e.g. C://users/yournamehere/.m2/repository

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

3 Comments

i I did everything and continue to have the same problems. what could it be?
i know, but i continues have the same problems with m2_repo
i Solved this, i only see a warning

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.