English 中文(简体)
gwt- maven- plectin 如何在另一个模块 pom. xml 中添加源罐
原标题:gwt-maven-plugin how to add the source jar in another module pom.xml
  • 时间:2012-05-22 05:45:31
  •  标签:
  • gwt
  • maven

我的应用程序有 2 模块, 一个是 jar, 另一个是 gwt 战争 。 在 jar 模块 (non- gwt) pom. xml 中, 我加

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-source-plugin</artifactId>
      <version>2.1.2</version>
      <executions>
         <execution>
           <phase>package</phase>
           <goals>
              <goal>jar-no-fork</goal>
           </goals>
         </execution>
      </executions>
     </plugin>
   </plugins>
</build>

and als-admin-viewer-core-1.0.0-sources.jar is successfully created. Then In the webapp(a gwt application) pom.xml, I want to use this jar, and 内the segment, I add

 <plugin>
   <groupId>org.codehaus.mojo<groupId>
   <artifactId>gwt-maven-plugin</artifactId>
   <version>2.4.0</version>
   <dependencies>
      <dependency>
    <groupId>hk.gov.ehr.service.tch.als</groupId>
    <artifactId>als-admin-viewer-core</artifactId>
    <version>1.0.0</version>    
   </dependency>
   <dependency>
    <groupId>hk.gov.ehr.service.tch.als</groupId>
    <artifactId>als-admin-viewer-core</artifactId>
    <version>1.0.0</version>
    <classifier>sources</classifier>
   </dependency>
  </dependencies>
  <execution>
  <phase>prepare-package</phase>
  <goals> 
    <goal>compile</goal>
  </goals>
  </executions>
........

but when I run maven install for this project (als-admin-viewer-webapp), error No source code is available for type hk.gov.ehr.service.tch.als.admin.viewer.core.LogSearchCriteria; did you forget to inherit a required module? is prompted.

有什么问题吗?

我甚至试图添加

<compileSourcesArtifacts>
  <compileSourcesArtifact>hk.gov.ehr.service.tch.als:als-admin-viewer-core</compileSourcesArtifact>  <!-- groupId:artifactId -->
</compileSourcesArtifacts>

<configuration> 

Gwt- maven- plectin 的一部分, 但仍没有帮助!

问题回答

我想你忘了在罐头模块中创建“ gwt. xml” 文件, 并继承在主 gwt. xml (内置 gwt maven 模块) 中的文件 。

Please look at http://mojo.codehaus.org/gwt-maven-plugin/user-guide/library.html

详情(“将一般用途的JARs作为GWT图书馆”一节)。

请注意: 如果您再次使用 Maven- source- plutin 来附加源, 您的源会与网络应用程序一同分布。 如果您使用“ compile Presources Artifacts ”, 您会避免这种副作用 。





相关问题
Refresh the UI in gwt

I have created some custom composite widget, which listens to an events (in my case loginEvent). Once the event is caught the state of the widget changes so as the way it should look (in my case I ...

How to create a development/debug and production setup

I recently deployed inadvertently a debug version of our game typrX (typing races at www.typrx.com - try it it s fun). It was quickly corrected but I know it may happen again. After digging on ...

GWT error at runtime: ....style_0 is null

My code works fine in IE 8, but on firefox 3.5, the javascript fails to load. I used firebug to figure out why, and the error I get is (GWT detailed mode) My suspicion is that some style is not ...

GWT s hosted mode not working

I ve been stumped for a while trying to figure out why my GWT demo app isn t working in hosted mode so I went back and downloaded the Google Web Toolkit again, unzipped it and simply went to the ...

How to disable Google Visualizations Tool Tips?

Does anyone know how to disable the tool-tip boxes that popup when a Google Visualizations chart is clicked (Selected)? Following the sample code at Getting Started with Visualizations, the "...

GWT 2 CssResource how to

I have a GWT 1.7 application and I want to upgrade it to GWT 2 Milestone 2. The application uses 2 big external CSS files. In GWT 1.7 I had a public folder and put both the CSS files in the folder and ...

热门标签