Eclipse Tomcat资源可用列表不包含Gwt 2.7.0 maven应用程序 [英] Eclipse Tomcat resources Available list doesn't contain Gwt 2.7.0 maven app

查看:709
本文介绍了Eclipse Tomcat资源可用列表不包含Gwt 2.7.0 maven应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图配置使用maven构建的我的GWT 2.7.0应用程序,以便与Eclipse IDE中的Tomcat7服务器一起工作。 我的项目



我的项目 gwt_2.7.0_maven_eclipse 不在那里。
我不明白为什么。



这是我的主要pom.xml:

 <?xml version =1.0encoding =UTF-8?> 
< project xmlns =http://maven.apache.org/POM/4.0.0xmlns:xsi =http://www.w3.org/2001/XMLSchema-instancexsi:schemaLocation =http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">

< modelVersion> 4.0.0< / modelVersion>
< groupId> pl.derp< / groupId>
< artifactId>父< / artifactId>
< packaging> pom< / packaging>
< version> 1.0.0-SNAPSHOT< / version>
<模块>
< module>服务器< / module>
< module> shared< / module>
< module> web< / module>
< / modules>

<属性>
< gwtVersion> 2.7.0< / gwtVersion>
< webappDirectory> $ {project.build.directory} / $ {project.build.finalName}< / webappDirectory>
< project.build.sourceEncoding> UTF-8< /project.build.sourceEncoding>
< tomcat.webport> 8082< /tomcat.webport>
< tomcat.ajpport> 8182< /tomcat.ajpport>
< tomcat.context> / parent< /tomcat.context>
< / properties>

<依赖关系>
< dependency>
< groupId> com.google.gwt< / groupId>
< artifactId> gwt-servlet< / artifactId>
< version> $ {gwtVersion}< / version>
< scope>运行时< / scope>
< /依赖关系>
< dependency>
< groupId> com.google.gwt< / groupId>
< artifactId> gwt-user< / artifactId>
< version> $ {gwtVersion}< / version>
< scope>提供< / scope>
< /依赖关系>
< dependency>
< groupId> junit< / groupId>
< artifactId> junit< / artifactId>
< version> 4.7< / version>
< scope> test< / scope>
< /依赖关系>
< dependency>
< groupId> javax.validation< / groupId>
< artifactId> validation-api< / artifactId>
< version> 1.0.0.GA< / version>
< scope> test< / scope>
< /依赖关系>
< dependency>
< groupId> javax.validation< / groupId>
< artifactId> validation-api< / artifactId>
< version> 1.0.0.GA< / version>
< classifier> sources< / classifier>
< scope> test< / scope>
< /依赖关系>
< /依赖关系>


< build>

< defaultGoal>干净安装tomcat7:仅限运行< / defaultGoal>

< plugins>
< plugin>
< groupId> org.codehaus.mojo< / groupId>
< artifactId> gwt-maven-plugin< / artifactId>
< version> $ {gwtVersion}< / version>
< / plugin>

< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-war-plugin< / artifactId>
< version> 2.3< / version>
< / plugin>

<! - IDE - >
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-eclipse-plugin< / artifactId>
< version> 2.7< / version> <! - Note 2.8不适用于AspectJ纵横道 - >
<配置>
< downloadSources> true< / downloadSources>
< downloadJavadocs> false< / downloadJavadocs>
< wtpversion> 2.0< / wtpversion>
< additionalBuildcommands>
< buildCommand>
< name> org.eclipse.jdt.core.javabuilder< / name>
<参数>
< / arguments>
< / buildCommand>
< buildCommand>
< name> com.google.gdt.eclipse.core.webAppProjectValidator< / name>
<参数>
< / arguments>
< / buildCommand>
< buildCommand>
< name> com.google.gwt.eclipse.core.gwtProjectValidator< / name>
<参数>
< / arguments>
< / buildCommand>
< / additionalBuildcommands>
< additionalProjectnatures>
< projectnature> com.google.gwt.eclipse.core.gwtNature< / projectnature>
< / additionalProjectnatures>
< / configuration>
< / plugin>

< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-compiler-plugin< / artifactId>
< version> 2.5.1< / version>
<配置>
< source> 1.8< / source>
< target> 1.8< / target>
< / configuration>
< / plugin>
< plugin>
< groupId> org.apache.tomcat.maven< / groupId>
< artifactId> tomcat7-maven-plugin< / artifactId>
< version> 2.0< / version>
<配置>
<路径> $ {tomcat.context}< / path>
< port> $ {tomcat.webport}< / port>
< ajpPort> $ {tomcat.ajpport}< / ajpPort>
< systemProperties>
< JAVA_OPTS> -XX:MaxPermSize = 256m< / JAVA_OPTS>
< / systemProperties>
< / configuration>
< / plugin>
< / plugins>
< / build>
< / project>

您能帮助我吗?
我为此付出了数日的努力,但无法完成工作。



我已经浏览了很多博客和教程。 >




编辑

这是我在Eclipse IDE中的第一个项目结构 p>



在linux shell中执行: mvn eclipse:eclipse ,它已经将我的单个应用程序项目重建为多个项目(通过项目I meen Eclipse项目)。在这样的结果中,我得到了这样的结构:








你还有一个奇怪的想法,那就是你有一个Eclipse项目,而不是3-4个,每个Maven模块一个。


I am trying to configure my GWT 2.7.0 app built with maven to work with Tomcat7 server inside the Eclipse IDE.

My project, here is link compiles and run fine in Tomcat server from linux console using maven. Here is how I run:

In first linux shell:

mvn clean install
mvn tomcat7:run-war-only

And in second shell:

mvn gwt:run -pl web

Add Tomcat resources window:

My project gwt_2.7.0_maven_eclipse is not there. I do not understand why.

Here is my main pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>pl.derp</groupId>
    <artifactId>parent</artifactId>
    <packaging>pom</packaging>
    <version>1.0.0-SNAPSHOT</version>
    <modules>
        <module>server</module>
        <module>shared</module>
        <module>web</module>
    </modules>

    <properties>
        <gwtVersion>2.7.0</gwtVersion>
        <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <tomcat.webport>8082</tomcat.webport>
        <tomcat.ajpport>8182</tomcat.ajpport>
        <tomcat.context>/parent</tomcat.context>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-servlet</artifactId>
            <version>${gwtVersion}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>${gwtVersion}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.7</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
            <classifier>sources</classifier>
            <scope>test</scope>
        </dependency>
    </dependencies>


    <build>

        <defaultGoal>clean install tomcat7:run-war-only</defaultGoal>

        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>${gwtVersion}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
            </plugin>

            <!-- IDE -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.7</version>  <!-- Note 2.8 does not work with AspectJ aspect path -->
                <configuration>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>false</downloadJavadocs>
                    <wtpversion>2.0</wtpversion>
                    <additionalBuildcommands>
                        <buildCommand>
                            <name>org.eclipse.jdt.core.javabuilder</name>
                            <arguments>
                            </arguments>
                        </buildCommand>
                        <buildCommand>
                            <name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
                            <arguments>
                            </arguments>
                        </buildCommand>
                        <buildCommand>
                            <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
                            <arguments>
                            </arguments>
                        </buildCommand>
                    </additionalBuildcommands>
                    <additionalProjectnatures>
                        <projectnature>com.google.gwt.eclipse.core.gwtNature</projectnature>
                    </additionalProjectnatures>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.0</version>
                <configuration>
                    <path>${tomcat.context}</path>
                    <port>${tomcat.webport}</port>
                    <ajpPort>${tomcat.ajpport}</ajpPort>
                    <systemProperties>
                        <JAVA_OPTS>-XX:MaxPermSize=256m</JAVA_OPTS>
                    </systemProperties>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Can any one of You help me with it? I struggle with it for few day, and cannot make it work.

I've already went over so many blogs and tutorial for this.


Edit

Here is my first project structure in Eclipse IDE

After some reading I've executed in linux shell: mvn eclipse:eclipse, which had rebuild my single app project into multi project (by project I meen Eclipse project). In the result of that I've got this structure:

解决方案

Your Eclipse project is not a "web application project" (it lacks some "facet").


It's still strange that you have a single Eclipse project and not 3–4 ones, one per Maven module.

这篇关于Eclipse Tomcat资源可用列表不包含Gwt 2.7.0 maven应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆