Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse在wtpwebapps中生成我的类三次_Eclipse_Jakarta Ee_Tomcat_Maven_M2eclipse - Fatal编程技术网

Eclipse在wtpwebapps中生成我的类三次

Eclipse在wtpwebapps中生成我的类三次,eclipse,jakarta-ee,tomcat,maven,m2eclipse,Eclipse,Jakarta Ee,Tomcat,Maven,M2eclipse,我对PrettyFaces框架有一个问题,即当使用eclipse在Tomcat6服务器上运行应用程序时,会多次发现一个类 我发现eclipse在wtpwebapps中多次生成类: \WEB-INF\classes\com\myapp\sample\beans\myclass.class WEB-INF\classes\target\classes\com\myapp\sample\beans\myclass.class \WEB-INF\classes\target\app-name\WEB-I

我对PrettyFaces框架有一个问题,即当使用eclipse在Tomcat6服务器上运行应用程序时,会多次发现一个类

我发现eclipse在wtpwebapps中多次生成类:

\WEB-INF\classes\com\myapp\sample\beans\myclass.class
WEB-INF\classes\target\classes\com\myapp\sample\beans\myclass.class
\WEB-INF\classes\target\app-name\WEB-INF\classes\com\myapp\sample\beans\myclass.class
更新:

我使用的是m2eclipse插件,并使用maven作为构建工具,可能它们的配置有误,或者需要配置一些东西

更新2:

这是pom文件的构建,可能我有点问题:

<build>

        <finalName>appName</finalName> 

        <resources>

            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>

        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>install</id>
                        <phase>install</phase>
                        <goals>
                            <goal>sources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-resources-plugin</artifactId>
               <version>2.5</version>
               <configuration>
               <encoding>UTF-8</encoding>
               </configuration>
            </plugin>
        </plugins>
    </build>

有什么办法解决这个问题吗?

我已经安装了m2e wtp连接器了吗?Maven->Discovery->在Indigo search wtp中打开目录

考虑使用:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

我想确认这是我在战争中没有看到的,请你以步骤的形式给出答案,因为我不知道你需要我做什么,顺便说一句,我正在使用helios。步骤1升级到Indigo E3.7这是迄今为止Eclipse的最佳版本,我从它开始就一直在使用WTP,您可能看到的是Helios E3.6的已知问题。
Temporarly Turn off: Project -> Build Automatically
Stop All Servers instances running like: Tomcat
Run As -> Maven -> clean
Servers -> Clean

Open file browser and validate for yourself outside of Eclipse that the following dirs are empty or non-existant:

  workspaceDirectory/projectDirectory/target   (the maven output folder)

  workspaceDirectory/metadata/.plugins/org.eclipse.wst.server.core/tmpX/wtpwebapps/**
  # This one is ok to have the top level contextPath's, provind they are currently active projects you have added to the server.

  $CATALINA_HOME/

Perform workspace refresh (to ensure Eclipse resync file system state to workspace state).  I do this with clicking on any project in Project Explorer, then Ctrl-Clicking it again to deselect it (so nothing is selected but Project Explorer is in focus) then press F5.   Other people use Ctrl-A to select all projects.

  Now do a Project -> Build All
  Now do a Servers -> Publish  (now check the tree you get)

  Now re-enable Project -> Build Automatically (if you run that way)