STS / Eclipse“Java EE”透视图无法识别maven目录结构

时间:2011-07-04 08:50:00

标签: eclipse maven

我是maven的新手,当我使用动态Web项目视角时,我正试图让eclipse识别maven目录结构。

所以我从这里开始提出这个问题:A Java web project created with Maven is not recognized as such by Eclipse我就这么做了:

  • 我在我的pom.xml中编辑了eclipse-plugin:

        <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 Perspective”中得到了我的Java文件夹,但是当我进入“Java EE”视角时,那里没有任何东西被识别出来。因此,源代码和webapps文件夹无法识别。

在版本方面,我使用SpringSource IDE版本2.3.1并使用maven版本3(此版本未附带maven prebundled所以我下载了最新版本的maven)

1 个答案:

答案 0 :(得分:0)

我已经看到当你运行eclipse时发生这种情况:eclipse命令,eclipse上的一些eclipse项目facets属性正在发生变化,要验证这在eclipse中这样做

选择项目==&gt; properties ==&gt;项目方面==&gt;动态Web模块(构面属性)

我认为未检查属性复选框(因此eclipse将无法识别您的Web项目)