0

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>
Jaroslav Záruba
  • 4,694
  • 5
  • 39
  • 58
  • For future seekers, explanation https://gwt-maven-plugin.github.io/gwt-maven-plugin/mergewebxml-mojo.html#compileSourcesArtifacts – Jaroslav Záruba May 19 '16 at 08:01
  • And one more note from Thomas B. on the element: https://groups.google.com/d/msg/codehaus-mojo-gwt-maven-plugin-users/IhRyRoDTiIQ/YlnMHKg8TDgJ – Jaroslav Záruba May 19 '16 at 08:07

1 Answers1

1

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

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
  • Thanks, seems you are right. Again. :) I'm confused now on what is the purpose of that element then. Also it would be nice if there was some documentation on what is the structure of supported configuration elements. :) – Jaroslav Záruba May 19 '16 at 08:00