I
I
Ivanhoe2012-10-22 00:19:54
Java
Ivanhoe, 2012-10-22 00:19:54

Java library dependency on another library, compilation and distribution

Good afternoon.

I am writing a small open source library in Java, I use Ant to build it. There was such a plan question about compilation and distribution.
My library depends on another library (jsoup html parser) which is required when compiling. There are such options:
1. Put the jsoup jar file in my repository.
Cons: extra binary in the repository.

2. Expect that the user has a jsoup of a specific version when compiling.
Cons: may not be present.
And also how to reflect this in build.xml in this case?

Wanted to know what is the standard practice.

It is also interesting how in this case to distribute the compiled assembly of your library - drag jsoup with you or expect that the user has it?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
D
dborovikov, 2012-10-22
@Ivanhoe

Use maven and the dependency will be pulled out by the user! Ant is already bad manners.

I
ivnik, 2012-10-22
@ivnik

I agree with dborovikov's comment about maven, but if you really need ant, I recommend looking at ivy .
PS Dependency for jsoup can be searched at search.maven.org

A
allnightlong, 2012-10-22
@allnightlong

I would recommend, not just maven, but already gradle .

J
javax, 2012-10-22
@javax

Plus maven.
Well, if you really want ant - pack the library with you.

R
relgames, 2012-10-22
@relgames

If you really want ant, but you need dependencies, you can look towards maven.apache.org/ant-tasks/index.html
Then even when building with ant, libraries can be downloaded during compilation.

J
jbaruch, 2012-11-04
@jbaruch

Linux repositories have nothing to do with it, we are talking about their repositories, such as search.maven.org and repo.jfrog.org/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question