Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRAILS-6996: Use spring artifacts from Maven Central rather than from EBR #4375

Closed
graemerocher opened this issue Dec 2, 2010 · 3 comments
Closed

Comments

@graemerocher
Copy link
Member

Original Reporter: ronnylovtangen
Environment: Not Specified
Version: 1.3.5
Migrated From: http://jira.grails.org/browse/GRAILS-6996

Spring artifacts are available in two different flavors; the traditional jars in Maven Central, and OSGi-compatible jars in Enterprise Bundle Repository (EBR)
Ref: http://static.springsource.org/spring/docs/upgrade/spring3/html/ch02s07.html

The same artifacts in these two repositories, have different artifactIds. E.g. {{spring-core}} in Maven Central corresponds to {{org.springframework.core}} in EBR.
The springsource page says; "Choose one place or the other for your project; do not mix them".

Grails brings in some spring-dependencies by default. These have artifactIds according to EBR.
Most 3rd party dependencies that has transitive dependencies to spring artifacts, uses artifactIds according to Maven Central, e.g. CXF that brings in {{spring-jms}}. Because of non-matching artifactId for the same artifacts, Ivy won't resolve it to one artifact, but two, and it's easy to end up having two jars of the same artifact in the final war-file. Possibly also with different version numbers.
E.g. {{org.springframework.jms-3.0.3.RELEASE.jar}} (from EBR) and {{spring-jms-2.5.6.jar}} (from Maven Central).

Now, I don't think there is need for the OSGi-compatible jars in Grails at the moment (the {{grails-maven-archetype}} creates a Grails project with just the Maven Central artifacts, not the EBR ones, and that works just fine).
It might be necessary with OSGi-compatible jars in the future, but for now it would be nice to stick with the ones from Maven Central, to avoid causing problems for Ivy dependency resolution.

Alternatively we could add some documentation to grails-doc chapter 3.7 on how to exclude the EBR artifacts.

Thread on the user list: http://grails.1312388.n4.nabble.com/artifactId-for-spring-dependencies-td3054163.html

@graemerocher
Copy link
Member Author

graemerocher said:
Yes IvyDependencyManager.getDefaultDependencies is the right place. The resolver used to resolve the jars can be found in the grailsHome() method of IvyDomainSpecificLanguageEvaluator

@graemerocher
Copy link
Member Author

pledbrook said:
Ronny, known issue: GRAILS-6700

@graemerocher
Copy link
Member Author

graemerocher said:
Fixed by this commit 0df1cbc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant