How to add new libraries?

1 view
Skip to first unread message

ron

unread,
Oct 10, 2009, 8:24:55 PM10/10/09
to savant-users
Hi,

I am trying to add a new log4j library in the project.xml as one of
"compile" 's artifact.. actually the project.xml file is generated by
JCatapult. How do I ask savant to download that library from a
repository?? when i do "svnt compile" it just complains about that
dependency is not found..

thanks.
ron

ron

unread,
Oct 11, 2009, 10:03:45 PM10/11/09
to savant-users
oh never mind.. bad maven URL.. just tried this URL (http://
mirrors.ibiblio.org/pub/mirrors/maven2/log4j/log4j/1.2.15/
log4j-1.2.15.jar.amd]
) and it works.. and of course need to create that workflows.xml.

However, when I do a "svnt compile" which require the log4j artifact,
it seems that it can fetch but it gives different errors asking for
some other java libraries.. is it because log4j depends on those?? Why
it can't automatically download them as well?? Does maven do that?


Here is the error i get:
[dependencypath] Fetched MetaData for artifact [log4j|log4j|
log4j-1.2.15.jar] from [Internet at
http://mirrors.ibiblio.org/pub/mirrors/maven2/log4j/log4j/1.2.15/log4j-1.2.15.jar.amd]
[dependencypath] Fetched [log4j-1.2.15.jar] from [Internet at
http://mirrors.ibiblio.org/pub/mirrors/maven2/log4j/log4j/1.2.15/log4j-1.2.15.jar]

BUILD FAILED
/Users/ron/crib/dummy/savant-build.xml:16: The following error
occurred while executing this line:
/Users/ron/.savant/plugins/org/jcatapult/savant/plugins/dbmgr/1.0.2/
ant/build.xml:21: Error(s) while resolving artifacts
Error list:
Error(s) while resolving artifacts
Unable to locate dependency [javax.mail|mail|mail-1.4.jar]
Unable to locate dependency [javax.jms|jms|jms-1.1.jar]
Unable to locate dependency [com.sun.jdmk|jmxtools|jmxtools-1.2.1.jar]
Unable to locate dependency [com.sun.jmx|jmxri|jmxri-1.2.1.jar]

ron

unread,
Oct 11, 2009, 10:17:06 PM10/11/09
to savant-users
Another thing I found out is that it is not really intuitive to specfy
artifact group:

At first I put this:
<artifact group="javax.mail" name="mail" version="1.4"/>

which is how maven specify in their metadata file:
metadata>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</metadata>

But that won't work for savant.. instead you need to reverse the group
name:

<artifact group="mail.javax" name="mail" version="1.4"/>

Is it possible to improve it such that "javax.mail" will also work??

Ronald

On Oct 11, 7:03 pm, ron <ronaldy...@gmail.com> wrote:
> oh never mind.. bad maven URL.. just tried this URL (http://
> mirrors.ibiblio.org/pub/mirrors/maven2/log4j/log4j/1.2.15/
> log4j-1.2.15.jar.amd]
> ) and it works.. and of course need to create that workflows.xml.
>
> However, when I do a "svnt compile" which require the log4j artifact,
> it seems that it can fetch but it gives different errors asking for
> some other java libraries.. is it because log4j depends on those?? Why
> it can't automatically download them as well?? Does maven do that?
>
> Here is the error i get:
> [dependencypath] Fetched MetaData for artifact [log4j|log4j|
> log4j-1.2.15.jar] from [Internet athttp://mirrors.ibiblio.org/pub/mirrors/maven2/log4j/log4j/1.2.15/log4...]
> [dependencypath] Fetched [log4j-1.2.15.jar] from [Internet athttp://mirrors.ibiblio.org/pub/mirrors/maven2/log4j/log4j/1.2.15/log4...]

ron

unread,
Oct 11, 2009, 10:18:34 PM10/11/09
to savant-users
And actually, make it automatically download other dependencies would
be even better... may be it is doing that but it just confuse with the
group name defined in maven.. not sure.

Brian Pontarelli

unread,
Oct 12, 2009, 5:56:15 PM10/12/09
to savant...@googlegroups.com
I believe that the Savant repository has the log4j JAR file in it. It
looks like it is here:

http://savant.inversoft.org/org/apache/logging/log4j/1.2.15/

You just need to ensure that the group, name, and version attributes
are correct. This should work:

<artifact group="logging.apache.org" name="log4j" version="1.2.15"/>

If you want to pull artifacts from the Maven2 repository, you'll need
to add that repository to your ~/.savant/workflows.xml file. Here's
the information on configuring that file:

http://code.google.com/p/savant-build/wiki/1_5WorkflowConfiguration

Then you can use the Maven2 group ID, artifact name and version
conventions.

Hope that helps.

-bp

Brian Pontarelli

unread,
Oct 12, 2009, 6:23:03 PM10/12/09
to savant...@googlegroups.com
Looks like a naming issue on those artifacts. Savant is actually using
the better group naming that follows the URL naming convention. The
javax is the top-level-domain and mail is the hostname of sorts. This
makes it easier to find all the javax artifacts. Both Maven and Savant
use an inverted folder hierarchy based on the group URL. Savant's
follow a more standard pattern than Maven's. Plus, those artifacts are
sometimes incorrectly named and placed in the Maven repositories.

If you consider that javax.mail would go into a folder named mail/
javax, this is backwards. All the similar artifacts should be grouped
into the same top level directory. So, in fact, the group should be
mail.javax and the directory should be javax/mail. This is all because
the URL is inverted and then turned into directories.

However, looks like Savant does have some errors with the names:

http://savant.inversoft.org/javax/mail/mail/1.4/javamail-1.4.jar

The JAR file should be named mail-1.4.jar instead. That is the more
correct approach. I've fixed that issue. You can now grab them here:

http://savant.inversoft.org/javax/mail/mail/1.4/mail-1.4.jar

The other JAR files don't seem to be in the Savant repository. If you
want to get access to the SubVersion repository that backs the Savant
repository, let me know. I must warn you that adding JAR files is a
tedious and painful process. ;)

-bp

Brian Pontarelli

unread,
Oct 12, 2009, 6:27:15 PM10/12/09
to savant...@googlegroups.com

Savant does all the transitive downloading. It actually handles
transitive dependencies and version capability much better than Maven
does. It follows more of an Ivy approach to it all. It builds a
dependency graph that contains each of the artifacts your project
depends on. It then puts in all of the artifacts those artifacts
depend on. This is done recursively until the entire graph is built.
Finally it resolves any version conflicts that might exists where the
graph contains multiple versions of the same artifact. All of this
happens prior to Savant downloading any of the JAR files.

-bp

ron

unread,
Oct 12, 2009, 9:35:49 PM10/12/09
to savant-users
yeah I did exactly that, adding the "http://mirrors.ibiblio.org/pub/
mirrors/maven2" to my workflows.xml.. but it seems that the maven's
"groupId" and the way savant interpret the group name is different..
is difficult to ask ibibio to "fix" their way to name things right,
and that is probably a popular maven repo also.. do you think it is ok
to make savant more flexible to address both formats??


Thanks for your reply by the way. I really want to use JCatapult/
Savant for my new project.
ron

ron

unread,
Oct 12, 2009, 9:50:31 PM10/12/09
to savant-users
yeah i don't want you to do extra work to maintain the savant repo and
I just don't see any reason to use savant repo when there are so many
maven repos out there already... i think to improve adoption it is
good to make it more flexible so it will just work with maven repo
even though it uses opposite group name format.. if it fails, reverse
it and try it again, no big deal right, just my opinion. OR, you can
make this configurable so user can turn on/off this "AI", by
specifying it in the project.xml for example.

ron
> >http://mirrors.ibiblio.org/pub/mirrors/maven2/log4j/log4j/1.2.15/log4...]
> > [dependencypath] Fetched [log4j-1.2.15.jar] from [Internet at
> >http://mirrors.ibiblio.org/pub/mirrors/maven2/log4j/log4j/1.2.15/log4...]

Brian Pontarelli

unread,
Oct 12, 2009, 10:00:31 PM10/12/09
to savant...@googlegroups.com
My hope is to just keep updating the Savant repositories to include
all these JAR files. Using the Maven repositories poses a number of
issues because Maven's POMs don't contain enough information to make
them equal to what Savant can support. In fact, you can run into
issues in some cases, depending on the artifacts and the POMs that are
in the Maven repository.

However, go ahead and log an issue and I'll see what I can do to get
that support into Savant.

-bp
Reply all
Reply to author
Forward
0 new messages