Created a possible solution for this 'real' problem.

The real problem is not that there is a dependency, but when using stand
alone ivy, multiple jars need to be included in the classpath (ivy-core and
commons-cli).

This can indeed be solved by (re)implementing commons-cli in ivy, but this
would duplicate code with all it's negative side effects.

What I did was added the Manifest attribute 'Class-Path', which it the way
to add references to other jars, on which ivy depens (ok, only commons-cli)
at the moment.

Having this problem solved, reminded me also to check if the Manifest
attribute 'Main-Class' was used and it wasn't :( This attribute makes it
possible to just start a jar! No additional path to the class with the main
method is needed.

So before you could start ivy with:
java  -cp ivy-core.jar:../../commons-cli.jar  org.apache.ivy.Main

Now becomes:
java  -jar ivy-core.jar

IMO also a better solution, as I think it's better to make use of existing
and proven code, then to re implement it yourself again. Plus this lets the
option open to make use of more / other external libs. Where a solution of
reimplementing cli, would also close to door of making use of other libs.

Reply via email to