I use GWT and a lot of classes from apache commons in a project. After changing ant to maven the conflicts with apache commons and gwt-dev appeared. Without gwt-dev lib dependency (but with manual set to classpath in order to use GWT Dev Mode) the following errors appear:
[ERROR] /project/branches/maven/server/project-server/target/generated-sources/gwt/com/project/client/Service_TypeSerializer.java:[20,3] cannot find symbol
[ERROR] symbol : class GwtScriptOnly
[ERROR] location: class com.project.client.Service_TypeSerializer
There are no /gwt/com/project/client folders in /project/branches/maven/server/project-server/target/generated-sources/.
With gwt-dev dependencies project doesn’t build at all.
Are there any solution on how to resolve apache commons and gwt conflicts?
This is a known issue, but actually I believe you should put your client and server code in separate Maven modules.
It’s cleaner: separation of concerns, also separates client dependencies from server dependencies –which would fix your issue–, and doesn’t unnecessarily package your client classes into the
WEB-INF/classes.Have a look at https://github.com/tbroyer/gwt-maven-archetypes for one way to do it (see also the announcement which has a bit of background).