Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 2.0.6
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Number of attachments :3
Description
I am trying to use the Ant task for Maven with the root Maven POM for
the Castor project for download the dependencies and place them into a
lib directory.
What I have observed is that there's a few dependencies missing when I
run the corresponding Ant target. But if I use Maven for the build
process, the missing JARs are downloaded as well and placed into my
local repository.
I have tried to define remoteRepository entries for the java.net and the
Maven 2 java.net repositories (where e.g. java.transaction:jta:1.1.1B
resides), but this does not make a difference.
Any idea what I could try in addition ? Having said that, all other
dependencies are resolved and copied without any problems. It looks like
it's just the dependencies that are not synced globally that create a
problem.
Activity
Actually, just verified that this issue is still an issue with 2.0.7.
Just wondering whether anybody will be able to look into this ?
I just ran your testcase and didn't find any problem: I get 9 .jar downloaded, that is perfectly coherent with what is detected in "Project Dependencies" report.
Could you be more precise than "there's a few dependencies missing": which ones? And what is the dependency path?
if you still have a problem, please reopen and help me reproduce it
Sorry, I did only get a message after you closed this issue. I will be back with an answer in a few hours ...
Looks like attached (by coincidence) a POM that did not include the dependency in question anymore, as they have been moved to another module. I'll re-attach a new POM in a few minutes.
Simply add the followinf dependency to the given POM:
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.0.1B</version>
</dependency>
and see whether you get a 10th JAR downloaded, i.e. the one for the JTA API.
surprisingly, I don't have any problem with this library: historically, this library was not in any public repo, due to old licencing restrictions: this was a classical problem, explained here http://maven.apache.org/reference/standard-sun-jar-names.html
to be able to use this version, you had to install it to your local repo by hand, or to a private repository, like explained in a lot of places, for example http://www.jugpadova.it/articles/2005/11/26/maven-2-spring-and-jta-depencies
but it seems that it has been added to java.net repo lately: http://download.java.net/maven/2/javax/transaction/jta/1.0.1B/
then I can reproduce any problems with your testcase
can you check it, please?
I am talking about the case where the JTA JAR is not installed into your local Maven repository, but where the given java.net repository should be used for dependency resolution. Given that the JAR eventually has been made available publically, we prefer that option. My problem is that Maven itself does not have any problems resolving that dependency and downloades the JAR into my local repo just fine. Whereas the Ant tasks for Maven only download the JARs that are available in standard public Maven 2 repos.
ok, I understand
I didn't have any problems when trying it, but I was using Maven Ant Tasks 2.0.8-SNAPSHOT, and I think you were hit by MANTTASKS-78: you define mutliple remote repositories, which is not well supported in 2.0.7
can you check that you don't have any problem now with 2.0.8-SNAPSHOT (available in http://maven.zones.apache.org/continuum/workingCopy.action?projectId=524&projectName=Maven+Ant+Task&userDirectory=target)
Using the following reduced POM, I am still seeing the problem as reported. When I use 'mvn eclipse:eclipse', all is fine, and the JAR is added to my set of project JARs. Whenever I try to use the attached Ant build script (even when deleting the first remoteRepository reference, the JTA JAR is not copied to the newlib directory (whereas the Xerces and log4j JARs are).
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor</artifactId>
<version>1.1.3-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.0.1B</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.13</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xerces</artifactId>
<version>1.4.0</version>
</dependency>
</dependencies>
<repositories>
<!--
<repository>
<id>java.net</id>
<name>java.net Maven Repository</name>
<url>https://maven-repository.dev.java.net/nonav/repository
</url>
<layout>legacy</layout>
</repository>
-->
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven 2</name>
<url>http://download.java.net/maven/2</url>
<layout>default</layout>
</repository>
</repositories>
</project>
ANy feedback would be appreciated. Note that I have been using Maven 2.0.7 and the snapshot given above for the Ant tasks for Maven
sorry, I don't have any problem with your example: everything works well for me.
Can you run "ant -v" and send the traces back?
There you are:
Apache Ant version 1.6.5 compiled on June 2 2005
Buildfile: C:\workspace\MavenJiraIssue\build.xml
parsing buildfile C:\workspace\MavenJiraIssue\build.xml with URI = file:///C:/workspace/MavenJiraIssue/build.xml
Project base dir set to: C:\workspace\MavenJiraIssue
parsing buildfile jar:file:/D:/bin/maven-2.0.8/maven-ant-tasks-2.0.8-SNAPSHOT.jar!/org/apache/maven/artifact/ant/antlib.xml with URI = jar:file:/D:/bin/maven-2.0.8/maven-ant-tasks-2.0.8-SNAPSHOT.jar!/org/apache/maven/artifact/ant/antlib.xml
[artifact:dependencies] Maven Ant Tasks version: 2.0.8-SNAPSHOT
[artifact:dependencies] Loading Maven settings file: C:\Dokumente und Einstellungen\me\.m2\settings.xml
[artifact:dependencies] Using local repository: D:\dev\maven\repository
[artifact:dependencies] Resolving dependencies...
[artifact:dependencies] Using remote repositories:
- id=java.net.maven2.repository, url=https://maven2-repository.dev.java.net/nonav/repository, releases=enabled, snapshots=enabled
- id=maven2-repository.dev.java.net, url=http://download.java.net/maven/2, releases=enabled, snapshots=enabled
- id=central, url=http://repo1.maven.org/maven2, releases=enabled, snapshots=disabled
org.codehaus.castor:castor:jar:1.1.3-SNAPSHOT (selected)
javax.transaction:jta:jar:1.0.1B:compile (selected)
log4j:log4j:jar:1.2.13:compile (selected)
xerces:xerces:jar:1.4.0:compile (selected)
Build sequence for target(s) `test-pom-deps' is [test-pom-deps]
Complete build sequence is [test-pom-deps, ]
test-pom-deps:
[copy] log4j\log4j\1.2.13\log4j-1.2.13.jar added as log4j-1.2.13.jar doesn't exist.
[copy] xerces\xerces\1.4.0\xerces-1.4.0.jar added as xerces-1.4.0.jar doesn't exist.
[copy] Copying 2 files to C:\workspace\MavenJiraIssue\newlib
[copy] Copying D:\dev\maven\repository\xerces\xerces\1.4.0\xerces-1.4.0.jar to C:\workspace\MavenJiraIssue\newlib\xerces-1.4.0.jar
[copy] Copying D:\dev\maven\repository\log4j\log4j\1.2.13\log4j-1.2.13.jar to C:\workspace\MavenJiraIssue\newlib\log4j-1.2.13.jar
BUILD SUCCESSFUL
Total time: 2 seconds
ok, thank you: I still don't understand in which detail the problem lies
There are 2 last points that could explain something:
1. can you post your C:\Dokumente und Einstellungen\me\.m2\settings.xml file
2. can you add a <localRepository path="./local"/> directive in your build.xml, to use a dedicated local repository
it's really frustrating!
My local settings.xml looks as follows (password altered):
[noformat}
<settings>
<localRepository>D:\dev\maven\repository</localRepository> -->
<servers>
<server>
<id>codehaus.org</id>
<username>wguttmn</username>
<password>password</password>
</server>
</servers>
</settings>
and I am not 100% sure what you want me to do/try with point 2.) as mentioned above. And feel free to join me on the #castor IRC channel at the Codehaus.
tried #castor, but nobody was here
When I'm connected, I'm on #maven
for the first point, I see you don't use any mirror, proxy, or anything fancy that could cause the problem
the second point is to try to work starting with an empty local repository: if javax.transaction:jta is broken in your local repository for whatever reason, starting from scratch will help
another idea: can you try
<get dest="." usetimestamp="true" ignoreerrors="true" src="http://download.java.net/maven/2/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar" />
> the second point is to try to work starting with an empty local repository: if javax.transaction:jta is broken in your local repository
> for whatever reason, starting from scratch will help
Herve, that could not be the case, as that would prevent Castor (the project where I am committer) from compiling at all. With, Castor, we currently use Maven (partially) to compile and test the code before final deployment. If things were broken in my local repo, I could not build at all. But I'll remove the JTA JAR from my local repo and see how it goes.
Output from runnin gthe <get> command as part of some An target ...
Apache Ant version 1.6.5 compiled on June 2 2005
Buildfile: C:\workspace\MavenJiraIssue\build.xml
parsing buildfile C:\workspace\MavenJiraIssue\build.xml with URI = file:///C:/workspace/MavenJiraIssue/build.xml
Project base dir set to: C:\workspace\MavenJiraIssue
parsing buildfile jar:file:/D:/bin/maven-2.0.8/maven-ant-tasks-2.0.8-SNAPSHOT.jar!/org/apache/maven/artifact/ant/antlib.xml with URI = jar:file:/D:/bin/maven-2.0.8/maven-ant-tasks-2.0.8-SNAPSHOT.jar!/org/apache/maven/artifact/ant/antlib.xml
[artifact:dependencies] Maven Ant Tasks version: 2.0.8-SNAPSHOT
[artifact:dependencies] Loading Maven settings file: C:\Dokumente und Einstellungen\me\.m2\settings.xml
[artifact:dependencies] Using local repository: D:\dev\maven\repository
[artifact:dependencies] Resolving dependencies...
[artifact:dependencies] Using remote repositories:
- id=java.net.maven2.repository, url=http://download.java.net/maven/2, releases=enabled, snapshots=enabled
- id=maven2-repository.dev.java.net, url=http://download.java.net/maven/2, releases=enabled, snapshots=enabled
- id=central, url=http://repo1.maven.org/maven2, releases=enabled, snapshots=disabled
org.codehaus.castor:castor:jar:1.1.3-SNAPSHOT (selected)
javax.transaction:jta:jar:1.0.1B:compile (selected)
log4j:log4j:jar:1.2.13:compile (selected)
xerces:xerces:jar:1.4.0:compile (selected)
Build sequence for target(s) `get.manually' is [get.manually]
Complete build sequence is [get.manually, test-pom-deps, ]
get.manually:
[get] Getting: http://download.java.net/maven/2/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
[get] To: C:\workspace\MavenJiraIssue\newlib\jta-1.0.1b.jar
BUILD SUCCESSFUL
Total time: 2 seconds
Just wondering whether the problem could be related to the fact that I am using a local repo which is not at the standard location.I might be completely wrong, but at least I have asked ..
.
[get] Getting: http://download.java.net/maven/2/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
[get] To: C:\workspace\MavenJiraIssue\newlib\jta-1.0.1b.jar
requesting jta-1.0.1B.jar you get jta-1.0.1b.jar: I don't really know if this little case difference could explain the problem.
can you delete files in your local repo before running Ant?
I'd like to see the output of the tasks downloading artifacts from repositories
Turns out that the problem was with the exact name of the JAR in my local repo. Deleting that download from my local repo and re-running Maven/Ant did the trick.
Castor's Maven 2 POM.