[GRADLE-2238] Use maven 3 classes to locate maven local repository Created: 16/Apr/12 Updated: 04/Jan/13 Resolved: 17/Jul/12
As part of the effort to include Java software in Fedora (http://fedoraproject.org) we are in the process of building and packaging Gradle. One of the issues we have is that Fedora has a very strict requirement: any software in Fedora should be buildable with software already existing in Fedora. In order to meet this requirement we are preparing using an ant build script to build a first version of Gradle that we can then to auto-build Gradle.
One of the issues we find with this approach is the following error:
Caused by: org.gradle.api.internal.artifacts.mvnsettings.CannotLocateLocalMavenRepositoryException: java.lang.NoSuchFieldException: userSettingsFile
Apparently the reason for this error is that the version of the DefaultLocalMavenRepositoryLauncher in maven 3 doesn't have the "userSettingsFile" field. Any suggestion on how to fix this? Do you have any plans to migrate to maven 3?
|Comment by René Gröschke (Inactive) [ 10/Jul/12 ]|
We just changed the implementation of the DefaultLocalMavenRepositoryLocator to use the maven 3 SettingsBuilder. Since we use maven2 libraries at other places in gradle we used jarjar (https://code.google.com/p/jarjar/) to repackage the settingsbuilder artifacts ("org.apache.maven:maven-settings-builder:3.0.4"). JarJar is shipped with an ant task and should be easy to integrate in your gradle ant build. The pattern we use for repackaging is:
|Comment by gil [ 11/Jul/12 ]|
|Comment by Carlo de Wolf [ 12/Aug/12 ]|
The only workable solution for Fedora would be to have an SPI in Gradle with a Maven 3 implementation backing it. You can also do a Maven 2 implementation and let a it be pluggable with a jar service provider.
Thus the Maven 3 implementation will have a true Maven 3 dependency, while the Maven 2 implementation will have a Maven 2 dependency. (So Fedora will not ship the Maven 2 implementation.)