Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
553 views
in Technique[技术] by (71.8m points)

java - ivy dependency on external JAR

I am battling with Ivy (I tried maven but had an event more difficult time setting up the JBoss repository for Hibernate).

Quick question - I am using this wonderful package: http://ooweb.sourceforge.net/index.html

Unfortunately, the JAR is only available through Sourceforge: http://sourceforge.net/projects/ooweb/files/ooweb/0.8.0/ooweb-0.8.0-bin.tar.gz/download

Is there a way to get Ivy to download a specific JAR?

For that matter, is it possible to do with Maven?

Or for that matter, how about Gradle?

Thank you! Misha

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Let's see if I understood you correctly ..

I can't speak for Ivy, but with Maven, you will sometimes have to install JARs manually to a repository, such as your local and possibly the one used when building your software.

Download the jar to your drive, and do something like this on command line:

mvn install:install-file -Dfile=ooweb.jar -DgroupId=ooweb -DartifactId=ooweb -Dversion=0.8.0 -Dpackaging=jar 

Pick a more sophisticated groupId is you want, these are what you'll use in your pom when defining the dependency.

Was there some specific issue you ran into when setting up the JBoss repo? I did it a while ago by just adding this at the end of a pom:

<repositories>
 <repository>
  <id>jboss</id>
  <url>http://repository.jboss.com/maven2</url>
  <releases>
    <enabled>true</enabled>
  </releases>
  <snapshots>
    <enabled>false</enabled>
  </snapshots>
</repository>
<repository>
  <id>jboss-snapshot</id>
  <url>http://snapshots.jboss.org/maven2</url>
  <releases>
    <enabled>true</enabled>
  </releases>
  <snapshots>
    <enabled>true</enabled>
  </snapshots>
</repository>


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...