控制 wtpwebapps 中应用程序类文件夹中的已发布文件和文件夹

发布于 2024-12-11 06:49:40 字数 3011 浏览 4 评论 0原文

我正在使用 eclipse helios 3.6.1WTP 3.2 以及 tomcat 7ma​​ven 2 作为构建工具,m2eclipse 插件。

当尝试从 Eclipse 在服务器上运行项目时,我遇到了无尽的异常 这与从 maven tomcat 插件运行我的项目相反,一切都工作得很好,

所以我比较了我的项目 (workspace/project/target/warFolder) 中生成的目标文件夹中提取的 war

和提取的 war在 (wtpwebapps/myapp)

,以下是内容:

1- (workspace/project/target/warFolder) 内容:

  • com
  • messages
  • MET-INF
  • import.sql
  • log4j.properties

2- (wtpwebapps/myapp)

  • com
  • 消息
  • MET-INF
  • import.sql
  • log4j.properties

  • src < /p>

  • 目标
  • .classpath
  • .project
  • file.txt
  • pom.xml

为什么它会生成那些额外的不需要的文件夹? 当我删除这些附加文件夹并尝试从 eclipse 在服务器上运行项目时,它运行良好,

所以问题是如何控制 eclipse 或 m2eclipse 或 maven 或导致问题不生成这些文件夹的任何内容,以及为什么我将它们放在第一位。

更新: POM 文件插件

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

            <plugin>

               <groupId>org.apache.tomcat.maven</groupId>
               <artifactId>tomcat7-maven-plugin</artifactId>
               <version>2.0-SNAPSHOT</version>
               <configuration>
               <path>/${project.build.finalName}</path>
               </configuration>


            </plugin>

        </plugins>

i am using eclipse helios 3.6.1 and WTP 3.2 with tomcat 7
and maven 2 as build tool, m2eclipse plugin.

when trying to run project on server from eclipse, i get endless exceptions
this is opposite to running my project from maven tomcat plugin, everything works very fine

so i compared between the extracted war in target folder generated in my project (workspace/project/target/warFolder)

and the extracted war in (wtpwebapps/myapp)

and here are the contents:

1- (workspace/project/target/warFolder) contents:

  • com
  • messages
  • MET-INF
  • import.sql
  • log4j.properties

2- (wtpwebapps/myapp)

  • com
  • messages
  • MET-INF
  • import.sql
  • log4j.properties

  • src

  • target
  • .classpath
  • .project
  • file.txt
  • pom.xml

why it generates those additional unneeded folders?
when i remove those additional folders and try to run project on server from eclipse it runs fine

so question is how to control eclipse or the m2eclipse or maven or whatever is causing the problem not to generate those folders, and why i get them in first place.

UPDATE: POM file plugins

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

            <plugin>

               <groupId>org.apache.tomcat.maven</groupId>
               <artifactId>tomcat7-maven-plugin</artifactId>
               <version>2.0-SNAPSHOT</version>
               <configuration>
               <path>/${project.build.finalName}</path>
               </configuration>


            </plugin>

        </plugins>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

苍风燃霜 2024-12-18 06:49:40

您是否安装了 Maven Integration for Eclipse WTP(又名 m2eclipse-wtp)?
有关更多详细信息,请参阅 https://github.com/sonatype/m2eclipse-wtp/wiki

Have you installed the Maven Integration for Eclipse WTP (aka m2eclipse-wtp)?
See https://github.com/sonatype/m2eclipse-wtp/wiki for more details.

柠栀 2024-12-18 06:49:40

从项目部署程序集中删除以下条目后,我解决了这个问题:

源: / 部署路径: WEB-INF/classes

但任何为什么我首先有这样的条目?

well i got this issue solved after removing the following entry from project deployment assembly:

Source: / Deploy Path: WEB-INF/classes

but any ideas why i had such entry in first place ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文