Thanks for the input, Leo. I am in unfamiliar territory so I really 
appreciate your perspective.

I want to set up the repository for the team/enterprise and I am starting 
with the simplest build we have on my computer, going one step at a time. 
I started by getting it running with all of my jars in the lib directory 
of the project (they are currently that way in Subversion). Then I got it 
running resolving the dependencies from public repositories with the 
minimum set of dependencies that resolved everything, allowing me to 
remove the jars from the lib directory.

Once I get that working the way I want - and this one jar is frustrating 
me - I want to move it to an enterprise repository. I am running Apache 
HTTP server locally to test accessing it through a URLResolver and that 
seems to work fine. I figure that however I get it into the Ivy repository 
on my computer is the way I would get it into Ivy on a repository server 
(running Apache HTTP too I assume) for location and enterprise 
accessibility.

What I want to end up with (I think) is a build that goes through a shared 
repository for a location, then a shared repository for the enterprise. I 
don't expect our builds to go against public repositories or allow anyone 
outside of the company access to our repositories.

Getting this jar into a repository seems like it should be easy. I gather 
by your response ("Wouldn't it be easier...") that it is not.(?)

-Andy




Leonard Axelsson <[email protected]> 
04/05/2011 03:36 AM
Please respond to
[email protected]


To
[email protected]
cc

Subject
Re: [gradle-user] Placing an arbitrary file into Ivy






Wouldn't it be easier to add the file to a lib folder in your repo and 
just use it using a files(...) dependency like this:


dependencies {
    runtime files('lib/jdbc-dependency.jar')

Maybe there's a better way but I don't see the benefit of putting it into 
the Ivy repository as it will only be available on your computer, and just 
as long as you don't clear the repository (or Ivy does it for you). There 
might be a usecase for publishing someone elses artifacts to a central 
repository if there's several people using that repository but otherwise 
I'd not suggest doing it.

My 2 c's

/Leo

On Tue, Apr 5, 2011 at 3:50 AM, Andy Goodspeed <[email protected]> 
wrote:
I am feeling rather dense. I am trying to place an arbitrary file - my 
database vendor's JDBC driver jar - into an Ivy repository for use by 
Gradle. (I am trying to replace an old Ant build without dependency 
management with a Gradle build using Ivy.) 

For the files I have that I can find in a public repository I am able to 
get them into Gradle, and therefore into Ivy. I am doing this with the 
following task after a successful build, which works whether it is good 
practice or not - comments welcome. 

task repoSetup(type: Copy) { 
  description = "Copy compile dependencies into Ivy repository" 
  from "${gradle.gradleUserHomeDir}/cache" 
  into "C:/ivy/repo" 
} 

I have the JDBC jar file supplied by my database vendor but I cannot find 
it in a public repository out there. So how do I get it into the Ivy 
repository, ideally with the organisation that I want? Is there some 
documentation that I have overlooked on doing this sort of thing? 

Thanks for any guidance. 

-Andy




-------------------------------------------------------
Leonard Axelsson
Agical AB

Blog: http://xlson.com/
Twitter: xlson

Reply via email to