Search code examples
gwtgwt-maven-plugin

compileSourcesArtifact not working...?


I have a project intended to work as a GWT library, which I prepare using this recommended approach. When I build my 'Library' project I can see the resulting JAR in the repository, I can even see it has *.java files in the 'shared' folder, also I see the defining XML, Library.gwt.xml.

But when I am building my 'main' it complains it can not find this JAR:
[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.8.0-beta1:compile (default) on project Web: artifact not found - Could not find artifact net.jzaruba:Library:jar:sources:1.7-SNAPSHOT

Note that my JAR is named Library-1.7-SNAPSHOT.jar, i.e. it is not a 'sources' JAR.
On the other hand when I build my Library project using the maven-source-plugin I get Library-1.7-SNAPSHOT-sources.jar and it is actually recognized by the main project.

Both GWT and gwt-maven-plugin are 2.8.0-beta1.

<build>/<plugins>/<plugin> in my 'main' project:

<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwt.version}</version>
....
<executions>
    <execution>
        <goals>
            <goal>compile</goal>
        </goals>
    </execution>
</executions>

<configuration>
    <compileSourcesArtifacts>
        <compileSourcesArtifact>net.jzaruba:Library</compileSourcesArtifact>
    </compileSourcesArtifacts>
    ...
<configuration>

Solution

  • You don't need compileSourcesArtifacts if the JAR contains the *.java files.