Saturday, April 22, 2017

Re: GWT/Maven development cycle takes much too long



On Saturday, April 22, 2017 at 12:29:26 PM UTC+2, Magnus wrote:
Hello,

I found it!
The error is caused by the following dependency:

    <dependency>
      <groupId>msm.lib.acs</groupId>
      <artifactId>msm-lib-acs</artifactId>
      <version>1.0-SNAPSHOT</version>
      <!--
      <scope>provided</scope>
      -->
    </dependency>

The error immediately disappears when I set the scope to provided again.
Now I can enable dependency resolution in eclipse again.

So far so good. But I also remember why I removed the provided scope.
Juan recommended this in another thread as a solution to another problem:

My app uses my lib (msm.lib.acs above), and my lib uses common libs from the maven repository, e. g. postgresql-42.0.0.jar.
The problem was that those libs were not copied into the application's WEB-INF/lib folder. So I ended up in missing jars.

And unfortunately this problem now reappeared. When I build the app with "mvn package", I end ab with a WEB-INF/lib folder not containing the external libs!

So I made one step backward, dependency resolution is enabled again, but the external jars are missing in the app folder.

This is expected: scope=provided means "this will be provided by 'the environment'" so it's not packaged inside the WAR (and transitive dependencies as well, of course).
And because the error you're having specifically happens when trying to copy the JAR into the WEB-INF/lib, if you say that this should no longer happen (by using scope=provided), then the error goes away.
 
Maybe another scope is better?

No.
The problem is that Eclipse wants to package your app.
As hinted in my other message, maybe this has been worked around in more recent versions of the maven-war-plugin (though I still believe the problem is with Eclipse and trying to package the app on project import) 

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment