Adam Murdoch wrote:


On 29/12/09 8:44 PM, Paul Speed wrote:
Here is what I use that works:
mavenRepo name:'myrepo', urls:new File( System.getProperty( "user.home" ), ".m2/repository" ).toURL().toString()

I really want to make my own mavenExtended plug-in that does this by default because it's kind of annoying to put this in every build file. :)

I wonder if the maven plugin should do this by default. Or perhaps offer

I've hinted at that before. :)

a mavenCache() method, so you can do this:

repositories {
    mavenCache()
}

It would be nice.

Since gradle doesn't seem to cross-share its own repository between different gradle projects (or at least still tries to download them from maven repos), using the local maven repository is really my only way to resolve these dependencies. And even if gradle did, there is still a big benefit in pulling in the maven stuff since some projects may be stuck on maven or I may have force installed jars into it... or I just may want to make sure I'm 100% compatible with maven builds.

For me, it actually goes all ways. I have gradle builds that depend on maven generated artifacts and maven builds that depend on gradle generated artifacts. Oh, and the more common, gradle project hierarchies that depend on completely independent gradle project artifacts.

-Paul




-Paul

tbee wrote:
I've managed to install a version of a jar in the local Maven repository, but I'm having troubles accessing it. I found this webpage describing how it is
done:

http://mrhaki.blogspot.com/2009/11/gradle-goodness-use-our-local-maven.html

So I added this to my build script:

mavenRepo urls: 'file://' + new File(System.getProperty('user.home'),
'.m2/repository').absolutePath

When running install, this is the output

[INFO] Installing ... to C:\Documents and
Settings\toeu\.m2\repository\nl\knowledgeplaza\KpUtil\1.5\KpUtil-1.5.jar

When I run build on the other component I see this:

        ==== file://C:\Documents and Settings\toeu\.m2\repository: tried

          file://C:\Documents and
Settings\toeu\.m2\repository/nl/knowledgeplaza/KpUtil/1.5/KpUtil-1.5.pom

          -- artifact nl.knowledgeplaza#KpUtil;1.5!KpUtil.jar:

          file://C:\Documents and
Settings\toeu\.m2\repository/nl/knowledgeplaza/KpUtil/1.5/KpUtil-1.5.jar

The files above are present, but the jar is not found. I suspect this may
have to do with the slashes and backslashes, but I'm not able to use
"getURI()" or "replaceAll('\\','/')", they all give exceptions.

Caused by: groovy.lang.MissingMethodException: No signature of method:
java.io.File.getURI() is applicable for argument types: () values: []


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to