ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Miller <neil_mil...@livewiremobile.com>
Subject module configurations issue on import
Date Tue, 01 Mar 2011 00:21:12 GMT
I'm having an issue with importing modules from a public maven repo 
(http://repo1.maven.org/maven2). I'm following the tutorial "Building a 
repository" with namespace rules 
(http://ant.apache.org/ivy/history/latest-milestone/tutorial/build-repository/advanced.html),

to import log4j version 1.2.16

At first I was having getting errors about attempts to overwrite an 
artifact. At that point I was using the following artifact pattern:
${basedir}/repository/[organisation]/[module]/[revision]/[artifact].[ext]

Looking at the ivy file for log4j, I saw that the jars and noticed that 
the artifacts for various jars all had the same name:
<publications>
<artifact name="log4j" type="bundle" ext="jar" conf="master"/>
<artifact name="log4j" type="source" ext="jar" conf="sources" 
m:classifier="sources"/>
<artifact name="log4j" type="javadoc" ext="jar" conf="javadoc" 
m:classifier="javadoc"/>
</publications>

So I added [conf] to the path and tried again, it still didn't work, so 
I added [type]
(Artifact pattern: 
"${basedir}/repository/[organisation]/[module]/[revision]/[conf]/[type]s/[artifact].[ext]")
and got the following directory structure:

apache/log4j/1.2.16/
     - default/
         - bundles/
             - log4j.jar
             - log4j.jar.md5
             - log4j.jar.sha1
         - javadocs/
             - log4j.jar
             - log4j.jar.md5
             - log4j.jar.sha1
         - sources/
             - log4j.jar
             - log4j.jar.md5
             - log4j.jar.sha1

Where the artifacts for the three configurations are all under "default" 
rather than "master", "sources", and "javaadoc". Is there something I'm 
missing here about the way [conf] works in the pattern? (really wish I 
could get at the classifier :) )

Thanks,
-n


The full ivy file for log4j:

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
<info organisation="apache"
         module="log4j"
         revision="1.2.16"
         status="release"
         publication="20100331002544"
         namespace="maven2"
 >
<license name="The Apache Software License, Version 2.0" 
url="http://www.apache.org/licenses/LICENSE-2.0.txt" />
<description homepage="http://logging.apache.org/log4j/1.2/">
         Apache Log4j 1.2
</description>
<m:maven.plugins>org.apache.maven.plugins__maven-resources-plugin__null|null__maven-surefire-plugin__2.5|null__maven-compiler-plugin__2.1|null__maven-jar-plugin__2.3|null__maven-antrun-plugin__1.2|null__maven-assembly-plugin__2.2-beta-5|null__maven-javadoc-plugin__2.6.1|null__maven-release-plugin__2.0-beta-9|null__maven-source-plugin__2.1.1|org.codehaus.mojo__clirr-maven-plugin__2.2.2|org.codehaus.mojo__rat-maven-plugin__1.0-alpha-3|org.apache.felix__maven-bundle-plugin__2.0.1</m:maven.plugins>
</info>
<configurations>
<conf name="default" visibility="public" description="runtime 
dependencies and master artifact can be used with this conf" 
extends="runtime,master"/>
<conf name="master" visibility="public" description="contains only the 
artifact published by this module itself, with no transitive dependencies"/>
<conf name="compile" visibility="public" description="this is the 
default scope, used if none is specified. Compile dependencies are 
available in all classpaths."/>
<conf name="provided" visibility="public" description="this is much like 
compile, but indicates you expect the JDK or a container to provide it. 
It is only available on the compilation classpath, and is not transitive."/>
<conf name="runtime" visibility="public" description="this scope 
indicates that the dependency is not required for compilation, but is 
for execution. It is in the runtime and test classpaths, but not the 
compile classpath." extends="compile"/>
<conf name="test" visibility="private" description="this scope indicates 
that the dependency is not required for normal use of the application, 
and is only available for the test compilation and execution phases." 
extends="runtime"/>
<conf name="system" visibility="public" description="this scope is 
similar to provided except that you have to provide the JAR which 
contains it explicitly. The artifact is always available and is not 
looked up in a repository."/>
<conf name="sources" visibility="public" description="this configuration 
contains the source artifact of this module, if any."/>
<conf name="javadoc" visibility="public" description="this configuration 
contains the javadoc artifact of this module, if any."/>
<conf name="optional" visibility="public" description="contains all 
optional dependencies"/>
</configurations>
<publications>
<artifact name="log4j" type="bundle" ext="jar" conf="master"/>
<artifact name="log4j" type="source" ext="jar" conf="sources" 
m:classifier="sources"/>
<artifact name="log4j" type="javadoc" ext="jar" conf="javadoc" 
m:classifier="javadoc"/>
</publications>
<dependencies>
<dependency org="javax.mail" name="mail" rev="1.4.1" force="true" 
conf="optional->compile(*),master(*)"/>
<dependency org="apache" name="oro" rev="2.0.8" force="true" 
conf="test->runtime(*),master(*)"/>
<dependency org="junit" name="junit" rev="3.8.2" force="true" 
conf="test->runtime(*),master(*)"/>
<dependency org="org.apache.geronimo.specs" name="geronimo-jms_1.1_spec" 
rev="1.0" force="true" conf="optional->compile(*),master(*)"/>
</dependencies>
</ivy-module>



Mime
View raw message