You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
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
The text was updated successfully, but these errors were encountered: