私のアプリケーションには 2 つのモジュールがあり、1 つは jar で、もう 1 つは gwt war です。jarモジュール(非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>
als-admin-viewer-core-1.0.0-sources.jar が正常に作成されました。次に、webapp(gwt アプリケーション) pom.xml で、この jar を使用したいので、セグメントに追加します
<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>
........
しかし、このプロジェクト (als-admin-viewer-webapp) に対して maven インストールを実行すると、エラー No source code is available for type hk.gov.ehr.service.tch.als.admin.viewer.core.LogSearchCriteria; 必要なモジュールを継承するのを忘れましたか? プロンプトが表示されます。
何が問題ですか?!!
私も追加しようとします
<compileSourcesArtifacts>
<compileSourcesArtifact>hk.gov.ehr.service.tch.als:als-admin-viewer-core</compileSourcesArtifact> <!-- groupId:artifactId -->
</compileSourcesArtifacts>
の
<configuration>
gwt-maven-plugin のセクションですが、それでも役に立ちません!!