mvn eclipse:eclipse
this will add all the dependencies you have in your pom.xml into eclipse... shell
however, if you haven't done any of this before you may need to do one other, one time only step. apache
Close eclipse, then run the following command from the shell: eclipse
mvn -Declipse.workspace=<eclipse workspace> eclipse:add-maven-repo
sample: maven
if you have m2e installed and the project already is a maven project but the maven dependencies are still missing, the easiest way that worked for me was ide
Diese Fehlermeldung erhalte ich, wenn ich versuche, direkt nach dem Import, ein mit Maven erzeugtes Projekt in Eclipse als „Maven Projekt「 zu konfigurieren.
Um den Fehler zu vermeiden muss nach dem Import, bei geöffnetem Eclipse, ein eclipse:clean durchgeführt werden. Danach kann das Projekt mittels „Configure「 -> „Convert to Maven Project「 fehlerfrei als Maven Projekt definiert werden.
Beispiel ui
# generate new project e.g. # format: liferay-portlet-archetype # version: 6.1.0 # groupId: de.scandio # artefactId: portlet-test # version: 1.0-SNAPSHOT # package: de.scandio.portlets
1
|
$ mvn generate:archetype
|
# build eclipse configuration files
1
|
$ mvn eclipse:eclipse
|
# switch to eclipse and import new generated project
1
2
3
4
|
'Import'
-> 'Existing Projects into Workspace'
-> 'Choose Folder'
-> 'Finish'
|
# Converting the project now leads to the described error
1
2
3
|
'Configure'
-> 'Convert to Maven Project'
-> ERROR!
|
# Remove the config, we need to clean project before converting
1
2
|
'Maven'
-> 'Disable Maven Nature'
|
# leave eclipse open and clean project configuration files
1
|
$ mvn eclipse:clean
|
# switch to eclipse, and configure the project as Maven project
1
2
3
|
'Configure'
-> 'Convert to Maven Project'
-> SUCCESS!
|