google-code-export / mvp4g

Automatically exported from code.google.com/p/mvp4g
1 stars 0 forks source link

mvp4g 1.3.1 Maven POM hard-coded dependency on GWT 2.2.0 causing problems #98

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
===Should not hard-code dependency on GWT version in mvp4g POM===

What steps will reproduce the problem?
1. Enable GWT 2.4.0 on project properties (not in maven)
2. Add dependency to mvp4g 1.3.1 in POM

What is the expected output? What do you see instead?
You will see that maven dependency states GWT 2.2.0.
While project Referenced libs says GWT 2.4.0

Then Eclipse editor gets confused and starts red-lining perfectly good code. 
And GWT compilation fails on cannot find classes where the path inheritance had 
worked just before enabling maven dependency.

What version of the product are you using? On what operating system?
STS 2.8/Eclipse 3.7, Win 7/64bit, JDK 7/1.6 compat, mvp4g 1.3.1.

Please provide any additional information below.
Should not hard-code dependency on GWT version in mvp4g POM. Should allow 
programmer freedom to use later versions of GWT.

Work-around:
Edit the mvp4g 1.3.1 POM in my .m2 cache to either
- update the GWT version to 2.4.0 or
- delete the dependency on GWT.

Original issue reported on code.google.com by BlessedGeek on 6 Oct 2011 at 1:37

GoogleCodeExporter commented 9 years ago
I'm not a maven expert so correct me if I'm wrong.

mvp4g dependency to GWT is set as "provided", which means that adding mvp4g to 
your dependencies, doesn't add gwt. You need to add it manualy.

Could your issue be fixed by adding GWT 2.4.0 dependency to your project?

Original comment by plcoir...@gmail.com on 6 Oct 2011 at 2:42

GoogleCodeExporter commented 9 years ago
"mvp4g dependency to GWT is set as provided"
is not true as for as if found in mvp4g POM.xml as found in maven central.

This request is actually to update the POM.xml to do exactly what you say, to 
have "GWT version dependency" specified by my project rather than being 
hard-coded into the mvp4g lib POM.

Take a look at the mvp4g 1.3.1 POM.xml which has been uploaded to maven central.

Setting the gwt version property to 2.4.0 on my project POM does not override 
the version 2.2.0 GWT jars that would get pulled in to my project. My project 
ends up with having both GWT 2.2.0 jars and 2.4.0 jars.

Original comment by BlessedGeek on 6 Oct 2011 at 7:19

GoogleCodeExporter commented 9 years ago
I doubled check but the dependency is set as provided: 
http://search.maven.org/remotecontent?filepath=com/googlecode/mvp4g/mvp4g/1.3.1/
mvp4g-1.3.1.pom

Could something be wrong with the pom you downloaded?

Original comment by plcoir...@gmail.com on 7 Oct 2011 at 2:13

GoogleCodeExporter commented 9 years ago
 http://search.maven.org/remotecontent?filepath=com/googlecode/mvp4g/mvp4g/1.3.1/mvp4g-1.3.1.pom has the line which forces dependency on gwt2.2.0.

<properties>
<gwt.version>2.2.0</gwt.version>
</properties>

My project wants gwt 2.4.0. So now I have both 2.2.0 jars and 2.4.0 jars, which 
confuses my gwt compilation.

Original comment by BlessedGeek on 7 Oct 2011 at 2:11

GoogleCodeExporter commented 9 years ago
Further down that POM is dependency on hard-coded property ${gwt.version}

<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.gwt.inject</groupId>
<artifactId>gin</artifactId>
<version>1.5.0</version>
</dependency>
</dependencies>

Original comment by BlessedGeek on 7 Oct 2011 at 6:28

GoogleCodeExporter commented 9 years ago
The property is just an easy way to set all gwt dependency to the same version. 
In the pom, gwt-user and gwt-dev dependencies are set as 'provided'. According 
to the 
[http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanis
m.html#Dependency_Scope maven documentation], your project has to set its own 
gwt jars.

Original comment by plcoir...@gmail.com on 7 Oct 2011 at 8:41

GoogleCodeExporter commented 9 years ago
Why does it happen so that when I have mvp4g on maven, I encounter gwt 
compilation error - where it complains I might have forgotten to include an 
inheritance or class not found eror.

But when, without change of code, I disabled maven dependency in my eclipse 
project but depended on the jars directly - I compiled without errors? 

Original comment by BlessedGeek on 9 Oct 2011 at 1:59

GoogleCodeExporter commented 9 years ago
sorry for the late reply.

Inside your maven pom configuration file, did you set the gwt version to the 
same value as the eclipse plugin?

When you say, you have compilation error, is it inside eclipse?

Original comment by plcoir...@gmail.com on 11 Oct 2011 at 10:04

GoogleCodeExporter commented 9 years ago
In my project pom:

<properties>
<gwt.version>2.4.0</gwt.version>
</properties>

Do you think that would override gwt.version in mvp4g's pom? It did not seem to.

Original comment by BlessedGeek on 14 Oct 2011 at 7:49

GoogleCodeExporter commented 9 years ago
This change will not affect mvp4g pom. 

Do you have GWT dependencies in your project pom?

<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.4.0</version>
</dependency>

Original comment by plcoir...@gmail.com on 17 Oct 2011 at 9:22

GoogleCodeExporter commented 9 years ago
I've finally got this issue resolved ...
The effective maven hierarchy kept pulling in gwt-servlet 2.2.0 not directly 
due to mvp4g but due to gin 1.5.0 hard-specifying gwt-servlet 2.2.0.

I had to specifically place a maven dependency

<dependency>
  <groupId>com.google.gwt</groupId>
  <artifactId>gwt-servlet</artifactId>
  <version>${gwt.version}</version>
</dependency>

Otherwise, my client was interpreting RPC thro 2.4.0 while my server was 
emitting encoding thro 2.2.0 causing some unserializable exceptions.

Original comment by BlessedGeek on 9 Feb 2012 at 2:28

GoogleCodeExporter commented 9 years ago
Thanks for the feedback. I'll close the issue.

Original comment by plcoir...@gmail.com on 10 Feb 2012 at 3:37