新建Maven 項目問題列表

1.How to add 「Maven Managed Dependencies」 library in build path eclipse?
添加maven依賴庫

A.
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

mvn -Declipse.workspace=/home/ft/workspaces/wksp1/ eclipse:add-maven-repo

B.

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

  • right click the project,
  • Maven,
  • Update Project...



2.ECLIPSE: „ENABLING MAVEN DEPENDENCY MANAGEMENT「 HAS ENCOUNTERED A PROBLEM

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!

Verwendete Versionen
Eclipse, Version: Juno Service Release 1, Build id: 20120920-0800
Apache Maven 2.2.1 (rdebian-6)
Java version: 1.6.0_24


3. Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from http://repo.maven.apache.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

Adding
<pluginManagement>     <plugins>         <plugin>             <groupId>org.apache.maven.plugins</groupId>             <artifactId>maven-resources-plugin</artifactId>             <version>2.6</version>         </plugin>     </plugins> </pluginManagement>
相關文章
相關標籤/搜索