On 01/05/2013 12:03 PM, tedhohio wrote:
Wayne Fay wrote
So I upgraded one of the supporting jars to Maven 2 and it seemed to work
What does this mean? How did you "upgrade" the jar to Maven 2?

Hope it's making sense,
We need more concrete details to be helpful. You should be able to
manage your dependencies via the various pom files.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail:
[email protected]
For additional commands, e-mail:
[email protected]

I converted using the convert plug-in, it produced the POM and compiling
using Maven 2 worked fine.  No errors -- at least not until I hit the
transitive dependencies when I updated the main app POM.  I 'assumed' that
having the newer dependency in the main app jar would override any
dependency from the supporting jar, but it's not.

Better example Spring.  The SpringFramework jar (1.2.8) contains a
org.springframework.util package with a class StringUtils.  I import that
into several class files and use several of the trim functions, part of
cleaning up user input.

With the maven2 compiled jar, the import is using the SpringFramework from a
different dependency which also have a org.springframework.util and a
StringUtils class, but the trim method I want to use isn't in that one --
even though my main app has the dependency in the POM.  It took me a while
to realize that the dependency hierarchy was pulling from other jars.
Frustrating!

Not really a Maven problem.
Maven can not select dependencies for you.
You need to fix up your dependencies and then test to make sure that the latest version of spring does the same thing as 1.2.8 which is pretty old. When the application is running, you will get only one version of each library and it is best to specify the one you want. The nicest way is to remove all version numbers and have a parent pom that includes a dependency management section whose only job is to specify versions. Then you are sure that all your code is compiled with the same version of Spring or whatever. When you are ready to move to a new version, just change it in the parent and when you recompile your child modules, they will all be compiled with the right version.



--
View this message in context: 
http://maven.40175.n5.nabble.com/Another-Maven-1-to-2-upgrade-issue-tp5754681p5754686.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




--
Ron Wheeler
President
Artifact Software Inc
email: [email protected]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to