I'd like to use Maven with my next GWT project. I've worked through Sonatype's "Maven by Example" and have converted some of my current libraries from Ant to Maven builds.
I've a database library which is used by GWT and non-GWT projects. With Ant, I'd simply copy the *.java, *.class, and *.gwt.xml files into the same jar file. I'm trying to do this with Maven. Initially I used the maven-resources-plugin with a copy-resources goal. This is not ideal as it requires the path to the database *.java and *.class files in my datebase-gwt's POM (as it did with Ant).
First off, if I put
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.1</version>
<compileSourcesArtifacts>
<compileSourcesArtifact>com.mycorp.database:db</compileSourcesArtifact>
</compileSourcesArtifacts>
</plugin>
in my pom.xml I get the error:
$ mvn clean install
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.mycorp.database:db-gwt:8.1 (/home/thad/dev/gen2/db-gwt/pom.xml) has 1 error
[ERROR] Malformed POM /home/thad/dev/gen2/db-gwt/pom.xml: Unrecognised tag: 'compileSourcesArtifacts' (position: START_TAG seen ...</version>\r\n <compileSourcesArtifacts>... @115:34) @ /home/thad/dev/gen2/db-gwt/pom.xml, line 115, column 34 -> [Help 2]
Why this error?
mvn install will run if I put <compileSourcesArtifacts> inside a configuration element, but there are no java or class files from db the resulting db-gwt-8.1.jar (though both db-8.1.jar and db-8.1-sources.jar are in my local repository).
I expect to see what I get with Ant, a db-gwt jar with
com/mycorp/Database.gwt.xml
com/mycorp/DbGwt.gwt.xml
com/mycorp/database/Foo.class
com/mycorp/database/Foo.java
com/mycorp/database/Bar.class
com/mycorp/database/Bar.java
...
Where Database.gwt.xml is
<module rename-to='db'>
<inherits name="com.google.gwt.core.Core"/>
<source path="database"/>
</module>
and DbGwt.gwt.xml is
<module rename-to='db-gwt'>
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.optix.Database' />
</module>
Is this what I should see? Or should I see a virtually empty jar file? If so, how to I declare dependencies in my GWT project? By stacking db-8.1.jar, db-8.1-sources.jar, and db-gwt-8.1.jar some how?
Thanks.