我是新來的maven,我試圖讓eclipse在我使用動態web項目透視時識別maven目錄結構。STS/Eclipse「Java EE」的視角無法識別maven目錄結構
於是我開始用的問題在這裏:A Java web project created with Maven is not recognized as such by Eclipse,我得到了這麼遠:
我編輯的Eclipse的插件,在我的pom.xml爲:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <version>2.6</version> <configuration> <wtpmanifest>true</wtpmanifest> <wtpapplicationxml>true</wtpapplicationxml> <wtpversion>2.0</wtpversion> <downloadSources>true</downloadSources> <additionalBuildcommands> <buildcommand>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</buildcommand> </additionalBuildcommands> <additionalConfig> <file> <name>.checkstyle</name> <url>http://rs.gbif.org/conventions/java-style-config.xml</url> </file> </additionalConfig> </configuration> </plugin>
然後我用命令
mvn eclipse:eclipse
,它給了以下的輸出:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building IPT 2.0.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-eclipse-plugin:2.6:eclipse (default-cli) @ ipt >>>
[INFO]
[INFO] --- buildnumber-maven-plugin:1.0-beta-4:create (default) @ ipt ---
[INFO] Checking for local modifications: skipped.
[INFO] Updating project files from SCM: skipped.
[INFO] Executing: cmd.exe /X /C "svn --non-interactive info"
[INFO] Working directory: C:\IOR_SVN\gbif-providertoolkit-read-only\gbif-ipt
[INFO] Storing buildNumber: 3391 at timestamp: 1309767247372
[INFO] Executing: cmd.exe /X /C "svn --non-interactive info"
[INFO] Working directory: C:\IOR_SVN\gbif-providertoolkit-read-only\gbif-ipt
[INFO] Storing buildScmBranch: trunk
[INFO]
[INFO] <<< maven-eclipse-plugin:2.6:eclipse (default-cli) @ ipt <<<
[INFO]
[INFO] --- maven-eclipse-plugin:2.6:eclipse (default-cli) @ ipt ---
[INFO] Adding support for WTP version 2.0.
[INFO] Using Eclipse Workspace: null
[INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAIN
ER
[WARNING] Invalid POM for org.apache.struts:struts2-core:jar:2.0.5, transitive d
ependencies (if any) will not be available, enable debug logging for more detail
s
[INFO] @@@ TRUE - Manifests are equal
[INFO] Not writing Manifest file as it is unchanged: C:\IOR_SVN\gbif-providertoo
lkit-read-only\gbif-ipt\src\main\webapp\META-INF\MANIFEST.MF
[INFO] Wrote settings to C:\IOR_SVN\gbif-providertoolkit-read-only\gbif-ipt\.set
tings\org.eclipse.jdt.core.prefs
[INFO] Wrote Eclipse project for "ipt" to C:\IOR_SVN\gbif-providertoolkit-read-o
nly\gbif-ipt.
所以做這個方法我在eclipse得到我的Java文件夾中的「Java透視圖」的認可,但是當我去的「Java EE」的觀點則沒有什麼是在那裏認出。所以源代碼以及webapps文件夾都沒有被識別。
在版本方面,我使用的SpringSource IDE 2.3.1版,我用maven第3版(這個版本沒有配備行家預先捆綁,所以我下載了最新的Maven)
您使用的是m2eclipse插件嗎? – artbristol