ppkarwasz commented on PR #191:
URL: https://github.com/apache/ant/pull/191#issuecomment-1206746776
Hi @jaikiran,
Thank you for the prompt answer. If the `<remoterepo>` element is outside of
`<resolve>` task, my Ant tries to retrieve the artifact from the default
repositories only (i.e. Maven Central).
I have only a basic understanding of how Ant works, but I don't understand
what should happen, when you instantiate an Ant type outside of the scope of a
target that uses it.
I attach the verbose log output of the failure:
```
piotr@bialykiel:~/masterWorkspace/ant$ rm -rf
~/.m2/repository/javax/media/jai-core/
piotr@bialykiel:~/masterWorkspace/ant$ ant -f fetch.xml -Ddest=optional -v
jai
Apache Ant(TM) version 1.10.5 compiled on August 27 2018
Buildfile: /home/piotr/masterWorkspace/ant/fetch.xml
Detected Java version: 11 in: /usr/lib/jvm/java-11-openjdk-amd64
Detected OS: Linux
parsing buildfile /home/piotr/masterWorkspace/ant/fetch.xml with URI =
file:/home/piotr/masterWorkspace/ant/fetch.xml
Project base dir set to: /home/piotr/masterWorkspace/ant
parsing buildfile
jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI =
jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip
file
[property] Loading /home/piotr/.ant/ant.properties
[property] Unable to find property file: /home/piotr/.ant/ant.properties
[property] Loading /home/piotr/masterWorkspace/ant/lib/libraries.properties
Importing file /home/piotr/masterWorkspace/ant/get-m2.xml from
/home/piotr/masterWorkspace/ant/fetch.xml
Overriding previous definition of reference to ant.projectHelper
parsing buildfile /home/piotr/masterWorkspace/ant/get-m2.xml with URI =
file:/home/piotr/masterWorkspace/ant/get-m2.xml
[property] Loading /home/piotr/masterWorkspace/ant/get-m2.properties
[property] Unable to find property file:
/home/piotr/masterWorkspace/ant/get-m2.properties
[macrodef] creating macro require
Overriding previous definition of reference to ant.projectHelper
[available] Unable to load class org.apache.commons.net.ftp.FTPClientConfig
to set property have.commons.net
Build sequence for target(s) `jai' is [pick-dest, probe-m2, download-m2,
dont-validate-m2-checksum, validate-m2-checksum, checksum-mismatch,
checksum-match, get-m2, macros, init, jai]
Complete build sequence is [pick-dest, probe-m2, download-m2,
dont-validate-m2-checksum, validate-m2-checksum, checksum-mismatch,
checksum-match, get-m2, macros, init, jai, junitlauncher,
get-m2.dont-validate-m2-checksum, bsf, ivy, antunit, graal.js, debugging,
get-m2.validate-m2-checksum, networking, -fetch-netrexx, jruby, beanshell,
rhino, script, -fetch-netrexx-no-commons-net, diag, junit-engine-vintage,
nonm2-macros, init-no-m2, init-cache, -setup-temp-cache, netrexx, jakartamail,
logging, junit, xml, regexp, antlr, bcel, jdepend, javamail, jspc, xz,
junit-engine-jupiter, all, get-m2.probe-m2, -cleanup-temp-cache, jython,
get-m2.download-m2, get-m2.checksum-mismatch, get-m2.get-m2,
get-m2.checksum-match, ]
pick-dest:
[echo] Downloading to /home/piotr/masterWorkspace/ant/lib/optional
probe-m2:
[available] Unable to load resource org/apache/maven/resolver/ant/antlib.xml
to set property m2.antlib.found
[antlib:org.apache.maven.resolver.ant] Could not load definitions from
resource org/apache/maven/resolver/ant/antlib.xml. It could not be found.
[available] Found file: lib/optional/maven-resolver-ant-tasks-1.4.0-uber.jar
download-m2:
Skipped because property 'm2.artifact.found' set.
dont-validate-m2-checksum:
validate-m2-checksum:
Skipped because property 'm2.artifact.found' set.
checksum-mismatch:
Skipped because property 'true' set.
checksum-match:
parsing buildfile
jar:file:/home/piotr/masterWorkspace/ant/lib/optional/maven-resolver-ant-tasks-1.4.0-uber.jar!/org/apache/maven/resolver/ant/antlib.xml
with URI =
jar:file:/home/piotr/masterWorkspace/ant/lib/optional/maven-resolver-ant-tasks-1.4.0-uber.jar!/org/apache/maven/resolver/ant/antlib.xml
from a zip file
get-m2:
macros:
[macrodef] creating macro f2
init:
jai:
Overriding previous definition of reference to jboss
[resolver:resolve] Using local repository /home/piotr/.m2/repository
(enhanced)
Using remote repository central (https://repo1.maven.org/maven2/, default,
releases)
Collecting dependencies
[resolver:resolve] Downloading
https://repo1.maven.org/maven2/javax/media/jai-core/1.1.3/jai-core-1.1.3.pom
[resolver:resolve] The POM for javax.media:jai-core:jar:1.1.3 is missing, no
dependency information available
[resolver:resolve] Resolved Dependency Graph:
[resolver:resolve] javax.media:jai-core:jar:1.1.3:runtime
[resolver:resolve] Resolving artifacts
[resolver:resolve] Downloading
https://repo1.maven.org/maven2/javax/media/jai-core/1.1.3/jai-core-1.1.3.jar
BUILD FAILED
/home/piotr/masterWorkspace/ant/fetch.xml:371: The following error occurred
while executing this line:
/home/piotr/masterWorkspace/ant/fetch.xml:123: Could not resolve artifacts:
Could not find artifact javax.media:jai-core:jar:1.1.3 in central
(https://repo1.maven.org/maven2/)
at
org.apache.maven.resolver.internal.ant.tasks.Resolve.execute(Resolve.java:166)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at java.base/java.util.Vector.forEach(Vector.java:1394)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:67)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at
org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:391)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:834)
at org.apache.tools.ant.Main.startAnt(Main.java:223)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
Caused by:
org.apache.maven.resolver.internal.ant.org.eclipse.aether.resolution.ArtifactResolutionException:
Could not find artifact javax.media:jai-core:jar:1.1.3 in central
(https://repo1.maven.org/maven2/)
at
org.apache.maven.resolver.internal.ant.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:431)
at
org.apache.maven.resolver.internal.ant.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:235)
at
org.apache.maven.resolver.internal.ant.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifacts(DefaultRepositorySystem.java:282)
at
org.apache.maven.resolver.internal.ant.tasks.Resolve.execute(Resolve.java:160)
... 31 more
Caused by:
org.apache.maven.resolver.internal.ant.org.eclipse.aether.transfer.ArtifactNotFoundException:
Could not find artifact javax.media:jai-core:jar:1.1.3 in central
(https://repo1.maven.org/maven2/)
at
org.apache.maven.resolver.internal.ant.org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:48)
at
org.apache.maven.resolver.internal.ant.org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:369)
at
org.apache.maven.resolver.internal.ant.org.eclipse.aether.util.concurrency.RunnableErrorForwarder.lambda$wrap$0(RunnableErrorForwarder.java:73)
at
org.apache.maven.resolver.internal.ant.org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:627)
at
org.apache.maven.resolver.internal.ant.org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:262)
at
org.apache.maven.resolver.internal.ant.org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
at
org.apache.maven.resolver.internal.ant.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:408)
... 34 more
Total time: 1 second
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]