2013-09-25 56 views
2

我一直在解決這個問題已經好幾個小時了。GWT Maven項目無法編譯 - 沒有源代碼可用於類型

試圖編譯Maven GWT項目,收到以下錯誤在GWT編譯點:

[INFO]編譯模塊com.ephesoft.dcma.gwt.login.Login
[INFO]驗證新編譯的單元
[INFO] [錯誤]'jar:file:/ D:/workspace2/dcma-root/dcma-gwt/dcma-gwt-core/target/dcma-gwt-core-0.0.14- > SNAPSHOT.jar!/com/ephesoft/dcma/gwt/core/client/validator/ValidatorFactory.java'
[INFO] [錯誤]第47行:沒有源代碼可用於com.ephesoft.dcma.core類型。 common.DataType;你忘了繼承一個必需的模塊嗎?
[INFO] [ERROR]'jar:file:/ D:/workspace2/dcma-root/dcma-gwt/dcma-gwt-core/target/dcma-gwt-core-0.0.14-SNAPSHOT.jar中的錯誤!/com/ephesoft/dcma/gwt/core/client/ui/RotatableImage.java'
[INFO] [ERROR]第54行:沒有源代碼可用於com.ephesoft.dcma.batch.schema.Direction類型;你忘了繼承一個必需的模塊嗎?
[INFO] [ERROR]'jar:file:/ D:/workspace2/dcma-root/dcma-gwt/dcma-gwt-core/target/dcma-gwt-core-0.0.14-SNAPSHOT.jar中的錯誤!/com/ephesoft/dcma/gwt/core/shared/comparator/DocumentTypeComparator.java」
...
...

和這樣的例子不勝枚舉...

這是我的webapp pom文件 -
dcma-root \ dcma-webapp \ 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/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <packaging>war</packaging> 

    <parent> 
     <groupId>com.ephesoft.dcma</groupId> 
     <artifactId>dcma-gwt</artifactId> 
     <version>0.0.14-SNAPSHOT</version> 
     <relativePath>../dcma-gwt</relativePath> 
    </parent> 
    <artifactId>dcma-webapp</artifactId> 
    <name>DCMA: Web application Model</name> 
    <description>The DCMA web Application model.</description> 

    <dependencies> 
     <dependency> 
      <groupId>com.ephesoft.dcma</groupId> 
      <artifactId>dcma-gwt-home</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>com.ephesoft.dcma</groupId> 
      <artifactId>dcma-gwt-login</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>com.ephesoft.dcma</groupId> 
      <artifactId>dcma-gwt-review-validate</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>com.ephesoft.dcma</groupId> 
      <artifactId>dcma-gwt-admin</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>com.ephesoft.dcma</groupId> 
      <artifactId>dcma-folder-monitor</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>com.ephesoft.dcma</groupId> 
      <artifactId>dcma-heart-beat</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>com.ephesoft.dcma</groupId> 
      <artifactId>dcma-mail-import</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>com.ephesoft.dcma</groupId> 
      <artifactId>dcma-gwt-batchInstance</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>com.ephesoft.dcma</groupId> 
      <artifactId>dcma-gwt-reporting</artifactId> 
     </dependency>  
     <dependency> 
      <groupId>com.ephesoft.dcma</groupId> 
      <artifactId>dcma-gwt-upload-batch</artifactId> 
     </dependency> 
    </dependencies> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-eclipse-plugin</artifactId> 
       <version>2.8</version> 
       <configuration> 
        <additionalProjectnatures> 
         <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> 
         <projectnature>com.google.gwt.eclipse.core.gwtNature</projectnature> 
         <projectnature>com.google.appengine.eclipse.core.gaeNature</projectnature> 
        </additionalProjectnatures> 
        <additionalBuildcommands> 
         <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand> 
         <buildcommand>com.google.gwt.eclipse.core.gwtProjectValidator</buildcommand> 
         <buildcommand>com.google.appengine.eclipse.core.enhancerbuilder</buildcommand> 
        </additionalBuildcommands> 
        <classpathContainers> 
         <classpathContainer>com.google.gwt.eclipse.core.GWT_CONTAINER</classpathContainer> 
        </classpathContainers> 
        <wtpversion>1.5</wtpversion> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>gwt-maven-plugin</artifactId> 
       <version>${gwt.maven.plugin.version}</version> 
       <executions> 
        <execution> 
         <configuration> 
          <modules> 
           <module>com.ephesoft.dcma.gwt.core.Core</module> 
           <module>com.ephesoft.dcma.batch.Batch</module> 
           <module>com.ephesoft.dcma.gwt.login.Login</module> 
           <module>com.ephesoft.dcma.gwt.admin.bm.BatchClassManagement</module> 
           <module>com.ephesoft.dcma.gwt.home.BatchList</module> 
           <module>com.ephesoft.dcma.gwt.rv.ReviewValidate</module> 
           <module>com.ephesoft.dcma.gwt.batchInstance.BatchInstance</module> 
           <module>com.ephesoft.dcma.gwt.reporting.Report</module> 
           <module>com.ephesoft.dcma.gwt.uploadbatch.UploadBatch</module> 
          </modules> 
          <localWorkers>2</localWorkers> 
          <extraJvmArgs>-Xmx768m</extraJvmArgs> 
          <sourcesOnPath>false</sourcesOnPath> 
          <force>true</force> 
         </configuration> 
         <goals> 
          <goal>compile</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 

    <profiles> 
     <profile> 
      <id>stand-alone</id> 
      <build> 
       <plugins> 
        <plugin> 
         <groupId>org.codehaus.mojo</groupId> 
         <artifactId>exec-maven-plugin</artifactId> 
         <version>1.1.1</version> 
         <executions> 
          <execution> 
           <phase>test</phase> 
           <goals> 
            <goal>java</goal> 
           </goals> 
           <configuration> 
            <mainClass>com.ephesoft.dcma.webapp.DCMAExecuter</mainClass> 
            <arguments> 
             <argument>none</argument> 
            </arguments> 
           </configuration> 
          </execution> 
         </executions> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 
    </profiles> 
</project> 

DCMA根\ DCMA-GWT \ DCMA-GWT登錄\ SRC \主\的java \ COM \ ephesoft \ DCMA \ GWT \登錄\ Login.gwt.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6.4//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.4/distro-source/core/src/gwt-module.dtd"> 
<module rename-to='login'> 
    <inherits name='com.google.gwt.user.User' /> 
    <inherits name='com.ephesoft.dcma.gwt.core.Core' /> 

    <entry-point class='com.ephesoft.dcma.gwt.login.client.LoginEntryPoint' /> 

</module> 

DCMA根\ DCMA-GWT \ DCMA-GWT核\ SRC \主\的java \ COM \ ephesoft \ DCMA \ GWT \核心\ Core.gwt.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<module rename-to='core'> 
    <inherits name='com.google.gwt.user.User' /> 
    <source path='client' /> 
    <source path='shared' /> 
    <inherits name="com.googlecode.gwt.math.Math" /> 
    <inherits name="com.ephesoft.dcma.batch.Batch" /> 
    <inherits name="com.ephesoft.dcma.core.Common" /> 
    <inherits name="com.ephesoft.dcma.da.Property" /> 
    <inherits name="com.google.gwt.i18n.I18N" /> 

    <inherits name='com.google.gwt.user.theme.standard.Standard' /> 
    <stylesheet src='css/style.css' /> 



</module> 

DCMA根\ DCMA -gwt \ dcma-gwt-core \ src \ main \ java \ com \ ephesoft \ dcma \ core \ Common.gwt.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<module rename-to='coreCommon'> 

    <inherits name='com.google.gwt.user.User' /> 
    <source path="common" /> 
</module> 

所以登錄包含Core,而Core又包含Common,那麼是什麼問題?

我會盡力幫助!

+0

如何Common.gwt.xml的''聲明? –

+0

<模塊命名到= 'coreCommon'> \t <繼承名= 'com.google.gwt.user.User'/> \t <源路徑= 「常見」/> 但那Common.gwt .xml的dcma-gwt-core的通用。 Core.gwt.xml中的繼承假設包含dcma.core.Common(與dcma-gwt-core相反)。或者我弄錯了? – sahar

回答

5

如果我正確地理解了這個問題,你需要編譯gwt-module,它依賴於另一個?因爲我們依賴模塊中使用的任務

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>gwt-maven-plugin</artifactId> 
    <version>${gwt.version}</version> 
    <executions> 
     <execution> 
     <goals> 
      <goal>compile</goal> 
     </goals> 
     </execution> 
    </executions> 
    <configuration> 
     <extraJvmArgs>-Xmx1024M</extraJvmArgs> 
     <localWorkers>3</localWorkers> 
     <optimizationLevel>${gwt.optimize}</optimizationLevel> 
     <style>OBF' -XenableClosureCompiler '-XenableClosureCompiler</style> 
     <workDir>${project.build.directory}/gwt/temp</workDir> 
     <deploy>${project.build.directory}/WEB-INF/deploy</deploy> 
     <modules> 
     <module>${module}</module> 
     </modules> 
     <hostedWebapp>${webappDirectory}</hostedWebapp> 
     <logLevel>WARN</logLevel> 
     <compileSourcesArtifacts> 
     <compileSourcesArtifact>groupId:artifactId</compileSourcesArtifact> 
     </compileSourcesArtifacts> 
    </configuration> 
    </plugin> 

<compileSourcesArtifact>groupId:artifactId</compileSourcesArtifact>看起來像<compileSourcesArtifact>com.google.gwt:gwt-user</compileSourcesArtifact>和核心模塊

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-source-plugin</artifactId> 
    <executions> 
     <execution> 
     <id>attach-sources</id> 
     <phase>package</phase> 
     <goals> 
      <goal>jar</goal> 
     </goals> 
     </execution> 
    </executions> 
    </plugin> 
+0

它的工作!我幾乎放棄了! 雖然做了一些修改 - gwt-maven-plugin版本必須是2.5.1,而我必須將gwt版本也更改爲2.5.1(否則發生ArrayIndexOutOfBoundsException)。另外,它是「compileSourcesArtifacts」中的「compileSourcesArtifact」元素。非常感謝! – sahar

相關問題