ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Jackson" <foamd...@gmail.com>
Subject Ant 1.7.0, with maven2
Date Mon, 23 Apr 2007 05:48:26 GMT
Hi all,

I've written a custom maven plugin that uses ant & ant-jsch as a
library and I've come across this problem when using the
org.apache.ant 1.7.0 jars

java.lang.IllegalArgumentException
        at java.net.URI.create(URI.java:842)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.launch.Locator.fromURI(Locator.java:162)
        at org.apache.tools.ant.launch.Locator.getResourceSource(Locator.java:11
9)
        at org.apache.tools.ant.launch.Locator.getClassSource(Locator.java:90)
        at org.apache.tools.ant.Project.setAntLib(Project.java:313)
        at org.apache.tools.ant.Project.initProperties(Project.java:309)
        at org.apache.tools.ant.Project.init(Project.java:295)
        at com.seanergie.maven.plugins.AbstractCustomDeployer.setSshTaskParamete
rs(AbstractCustomDeployer.java:342)
        at com.seanergie.maven.plugins.AbstractCustomDeployer.uploadFile(Abstrac
tCustomDeployer.java:257)
        at com.seanergie.maven.plugins.AbstractCustomDeployer.upload(AbstractCus
tomDeployer.java:221)
        at com.seanergie.maven.plugins.AbstractCustomDeployer.execute(AbstractCu
stomDeployer.java:196)
        at com.seanergie.maven.plugins.CustomDeployer.execute(CustomDeployer.jav
a:18)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:443)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:539)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:480)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:459)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: java.net.URISyntaxException: Illegal character in path at index 18: f
ile:/C:/Documents and Settings/Kev/.m2/repository/org/apache/ant/ant/1.7.0/ant-1
.7.0.jar
        at java.net.URI$Parser.fail(URI.java:2809)
        at java.net.URI$Parser.checkChars(URI.java:2982)
        at java.net.URI$Parser.parseHierarchical(URI.java:3066)
        at java.net.URI$Parser.parse(URI.java:3014)
        at java.net.URI.<init>(URI.java:578)
        at java.net.URI.create(URI.java:840)
        ... 33 more
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] null

Illegal character in path at index 18: file:/C:/Documents and Settings/Kev/.m2/r
epository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar

As you can see it's related to how the space characters in the
"Documents and Settings" strings are being handled.

Looking back at the Locator source I think the problem is related to
not encoding the uri before using it in the fromURI method.  I'm
trying to verify this now, but as always maven is making my life
difficult :(

Kev

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message