与Maven的多项目GWT

时间:2012-07-12 16:13:06

标签: gwt maven multi-project

我试图用这个例子用GWT做一个多项目:

http://mojo.codehaus.org/gwt-maven-plugin/user-guide/multiproject.html

所以,我有3个项目: reactor transferencias WebCore

reactor 项目是管理所有项目的项目

transferencias 项目有一些gwt模块, WebCore 项目是使用 transferencias 的gwt模块的主要Web应用程序这意味着我需要Transferencias项目导出* .gwt和* .java作为资源,因此GWT可以生成javascript文件。

在transferencias项目中,我在pom文件中有以下代码

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
    <groupId>com.pe.interbank</groupId>
    <artifactId>reactor</artifactId>
    <version>1.0.0</version>
    <relativePath>../reactor</relativePath>
</parent>


<properties>
    <path2>Reactor/pom.xml</path2>
    <path1>C:/Angelo/Workspace/MultipleGWTv2/Reactor/pom.xml</path1>
</properties>

<artifactId>transferencias</artifactId>
<packaging>jar</packaging>
<name>transferencias</name>

<build>
    <resources>
        <resource>
            <directory>src/main/java</directory>
            <includes>
                <include>**/*.java</include>
                <include>**/*.gwt.xml</include>
            </includes>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <version>2.4.0</version>
            <configuration>
                <compileSourcesArtifacts>
                    <compileSourcesArtifact>com.pe.interbank:transferencias</compileSourcesArtifact>
                </compileSourcesArtifacts>
            </configuration>
        </plugin>
    </plugins>


</build>

<dependencies>
    <dependency>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>2.4.0</version>
    </dependency>
</dependencies>

当我通过maven清理并安装它时,它很好,但当我清理并安装 WebCore 时,我收到了以下错误:

  

无法执行目标   org.codehaus.mojo:gwt-maven-plugin:2.4.0:在项目上编译(默认)   webapp:找不到GWT模块com.pe.interbank.transferencias   项目来源或资源。

似乎 transferencias 项目不会导出资源。但我不知道我做错了什么!

有什么想法吗?

编辑:

WebCore Pom

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
    <groupId>com.pe.interbank</groupId>
    <artifactId>reactor</artifactId>
    <version>1.0.0</version>
    <relativePath>../reactor</relativePath>
</parent>

<properties>
    <path2>Reactor/pom.xml</path2>
    <path1>C:/Angelo/Workspace/MultipleGWTv2/Reactor/pom.xml</path1>
</properties>

<artifactId>webapp</artifactId>
<packaging>war</packaging>
<name>webapp</name>

<dependencies>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-user</artifactId>
        <version>2.4.0</version>
    </dependency>

    <!-- this is the dependency to the "jar"-subproject -->
    <dependency>
        <groupId>com.pe.interbank</groupId>
        <artifactId>transferencias</artifactId>
        <version>1.0.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.tomcat</groupId>
        <artifactId>catalina</artifactId>
        <version>6.0.26</version>
    </dependency>

</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <version>2.4.0</version>
            <executions>
                <!-- GWT version detected from dependencyManagement -->
                <execution>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <runTarget>com.pe.interbank.Inicio/Inicio.html</runTarget>
                <draftCompile>true</draftCompile>
                <optimizationLevel>1</optimizationLevel>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1</version>
            <configuration>
                <warSourceDirectory>war</warSourceDirectory>
                <webXml>src/main/webapp/WEB-INF/web.xml</webXml>
            </configuration>
        </plugin>
    </plugins>
</build>

0 个答案:

没有答案