Issue Details (XML | Word | Printable)

Key: GMAVEN-23
Type: Bug Bug
Status: Open Open
Priority: Blocker Blocker
Assignee: Jason Dillon
Reporter: James Lorenzen
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
GMaven

Ant Dependency fails to resolve

Created: 15/Jun/08 09:41 PM   Updated: 04/Jul/09 12:06 AM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. XML File pom.xml (3 kB)

Environment: linux (ubuntu), maven 2 v2.0.9, jdk 1.5.0_12, gmaven v 1.0-rc-2
Issue Links:
Related
 

Testcase included: yes


 Description  « Hide

I am trying to use the optional Ant FTP task in a groovy script using the gmaven plugin but I continue to get a ClassNotFoundException. I did get the commons-lang example working that uses the SystemUtils class though, so I am not sure what the difference is.

I have attached my POM.

Here is the error:

[INFO] [groovy:execute {execution: default}]
[INFO] Entering in ftp script
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] : Problem: failed to create task or type ftp
Cause: the class org.apache.tools.ant.taskdefs.optional.net.FTP was not found.
This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
-ANT_HOME/lib
-the IDE Ant configuration dialogs

Do not panic, this is a common problem.
The commonest cause is a missing JAR.

This is not a bug; it is a configuration problem
--------------------------------------------

Now I know I could probably fix this issue by dropping the jar file in ANT_HOME, but I don't want to do that because I have several machines I would have to update including all the developers on the team having to do the same. Besides it should work by specifying a classpath element.



Jason Dillon made changes - 28/Jun/08 04:09 AM
Field Original Value New Value
Fix Version/s 1.0-rc-3 [ 14302 ]
Jason Dillon added a comment - 08/Jul/08 01:06 PM

I think the commons-lang doc is a bug, since commons-lang is already in the classpath from transitive deps. Will have a look at what is wrong shortly.


Jason Dillon added a comment - 10/Aug/08 05:41 AM

Well, I think I understand why this is problematic now, due to the provider classloader having the ant bits, which is the parent of the classloader which contains the project+user bits, thus antbuilder (and ant) can't see it.

Though you can actually import the class and use it directly:

import org.apache.tools.ant.taskdefs.optional.net.FTP
println FTP

I'm going to ponder how to fix this more. Not sure it will make it into rc-3 though, as I think the change is rather large.


Jason Dillon made changes - 10/Aug/08 05:42 AM
Fix Version/s 1.0-rc-3 [ 14302 ]
Fix Version/s 1.0-rc-4 [ 14308 ]
James Lorenzen added a comment - 11/Aug/08 12:23 PM

I can't believe I didn't actually try importing the class explicity.
I think that is a sufficient work around. Ideally it would be nice if it just used the dependencies.


Jason Dillon made changes - 09/Sep/08 12:20 AM
Fix Version/s 1.0-rc-4 [ 14308 ]
Fix Version/s 1.1 [ 14311 ]
Jason Dillon added a comment - 09/Sep/08 12:24 AM

I've looked into this a lot more over the past few days, and I think I can make this work, at the cost of creating new classloaders for each execution... might not be too expensive to get the class scoping correct/as expected. Won't change this until after 1.0 is out though.


Jason Dillon made changes - 27/Feb/09 10:29 PM
Link This issue relates to MGROOVY-189 [ MGROOVY-189 ]
Jason Dillon made changes - 04/Jul/09 12:06 AM
Affects Version/s 1.0-rc-2 [ 13918 ]
Fix Version/s 1.1 [ 14311 ]
Component/s execute [ 12732 ]
Workflow Maven New [ 90408 ] jira [ 112755 ]
Key MGROOVY-152 GMAVEN-23
Project GMaven (OLD) [ 11532 ] GMaven [ 11924 ]