IVY: Cannot resolve restlet dependency - ivy

I have a java project setup and wanted to use ivy as dependency management tool. However, I could not get the simplest one to work.
Here is the code I have:
ivy.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info
organisation="de.fau.fsahoy"
module="de.fau.fsahoy.android.api15"
status="integration">
</info>
<dependencies>
<dependency org="org.restlet.android" name="org.restlet" rev="2.1-RC5"/>
</dependencies>
</ivy-module>
ivysettings.xml
<?xml version="1.0"?>
<ivysettings >
<settings defaultResolver="maven" />
<resolvers>
<chain name="maven" returnFirst="true">
<ibiblio name="restlet" m2compatible="true" root="http://maven.restlet.org/" />
</chain>
</resolvers>
</ivysettings>
The errors I get are:
Impossible to resolve dependencies of de.fau.fsahoy#de.fau.fsahoy.android.api15;working#JonasErl-PC
Failed to load the descriptor for ivysettings.xml[*] in fsahoy-team-d-gitThe ivy file 'C:\Users\JonasErl\Code\fsahoy-team-d-git\ivysettings.xml' could not be parsed: null in file:/C:/Users/JonasErl/Code/fsahoy-team-d-git/ivysettings.xml
org.apache.ivyde.eclipse.IvyDEException: The ivy file 'C:\Users\JonasErl\Code\fsahoy-team-d-git\ivysettings.xml' could not be parsed: null in file:/C:/Users/JonasErl/Code/fsahoy-team-d-git/ivysettings.xml
at org.apache.ivyde.eclipse.CachedIvy.getModuleDescriptor(CachedIvy.java:376)
at org.apache.ivyde.eclipse.resolve.IvyResolveJob.run(IvyResolveJob.java:137)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.text.ParseException: null in file:/C:/Users/JonasErl/Code/fsahoy-team-d-git/ivysettings.xml
at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:301)
at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser.parseDescriptor(XmlModuleDescriptorParser.java:116)
at org.apache.ivy.plugins.parser.ModuleDescriptorParserRegistry.parseDescriptor(ModuleDescriptorParserRegistry.java:88)
at org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser.parseDescriptor(AbstractModuleDescriptorParser.java:48)
at org.apache.ivyde.eclipse.CachedIvy.getModuleDescriptor(CachedIvy.java:368)
... 2 more
Caused by: java.lang.NullPointerException
You can have a look at the repository structure at maven.restlet.org
These errormessages are not the very best unfortunately. How can I fix this?

I could not reproduce your error....
What version of ivy are you using?
How are you invoking the ivy tasks?
Test
build.xml
<project name="demo" default="init" xmlns:ivy="antlib:org.apache.ivy.ant">
<target name="init">
<ivy:resolve/>
</target>
<target name="clean">
<ivy:cleancache/>
</target>
</project>
Build output
init:
[ivy:resolve] :: Apache Ivy 2.3.0-rc1 - 20120416000235 :: http://ant.apache.org/ivy/ ::
[ivy:resolve] :: loading settings :: file = /home/mark/tmp/ivysettings.xml
[ivy:resolve] :: resolving dependencies :: de.fau.fsahoy#de.fau.fsahoy.android.api15;working#mark-laptop
[ivy:resolve] confs: [default]
[ivy:resolve] found org.restlet.android#org.restlet;2.1-RC5 in restlet
[ivy:resolve] downloading http://maven.restlet.org/org/restlet/android/org.restlet/2.1-RC5/org.restlet-2.1-RC5.jar ...
[ivy:resolve] ..............................................................................................................................................................................................................................................................................................................................................................................................
[ivy:resolve] ................ (699kB)
[ivy:resolve] .. (0kB)
[ivy:resolve] [SUCCESSFUL ] org.restlet.android#org.restlet;2.1-RC5!org.restlet.jar (1880ms)
[ivy:resolve] downloading http://maven.restlet.org/org/restlet/android/org.restlet/2.1-RC5/org.restlet-2.1-RC5-sources.jar ...
[ivy:resolve] ............................................................................................................................................................................................................................................................................................................................................................................................................................................................... (738kB)
[ivy:resolve] .. (0kB)
[ivy:resolve] [SUCCESSFUL ] org.restlet.android#org.restlet;2.1-RC5!org.restlet.jar(source) (971ms)
[ivy:resolve] :: resolution report :: resolve 1713ms :: artifacts dl 2864ms
---------------------------------------------------------------------
| | modules || artifacts |
| conf | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
| default | 1 | 1 | 1 | 0 || 2 | 2 |
---------------------------------------------------------------------

Related

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5

I am trying to build new item in jenkins (1st time) to run autotest in maven.
I configure the jenkins and press build now.
There is a problem I can't find the answer and ask for help please.
This is the error in the console :
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) # miron ---
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/3.0.0-M5/maven-surefire-common-3.0.0-M5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 43.979 s
[INFO] Finished at: 2022-02-23T10:29:40+02:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "Regression" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project miron: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-surefire-plugin:jar:3.0.0-M5 -> org.apache.maven.surefire:maven-surefire-common:jar:3.0.0-M5: Failed to read artifact descriptor for org.apache.maven.surefire:maven-surefire-common:jar:3.0.0-M5: Could not transfer artifact org.apache.maven.surefire:maven-surefire-common:pom:3.0.0-M5 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/3.0.0-M5/maven-surefire-common-3.0.0-M5.pom: Connect to repo.maven.apache.org:443 [repo.maven.apache.org/199.232.192.215, repo.maven.apache.org/199.232.196.215] failed: Connection timed out: connect -> [Help 1]
I am working from work (company).
My POM :
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
</build>
Can someone help me solve it please ?

detekt doesn't generate report

I'm building my project by maven. The detekt configuration was added based on the official documentation:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<inherited>false</inherited>
<executions>
<execution>
<!-- This can be run separately with mvn antrun:run#detekt -->
<id>detekt</id>
<phase>validate</phase>
<configuration>
<target name="detekt">
<java taskname="detekt" dir="${project.basedir}"
fork="true"
failonerror="false"
classname="io.gitlab.arturbosch.detekt.cli.Main"
classpathref="maven.plugin.classpath">
<arg value="--input"/>
<arg value="${project.basedir}/src/main/kotlin"/>
<arg value="--config"/>
<arg value="${project.basedir}/src/main/resources/sv_detekt.yml"/>
<arg value="--filters"/>
<arg value=".*/test/.*,.*/target/.*,.*/resources/.*"/>
<arg value="--output"/>
<arg value="${project.build.directory}/detekt-reports"/>
<arg value="--output-name"/>
<arg value="checkstyle-result"/>
/>
</java>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>io.gitlab.arturbosch.detekt</groupId>
<artifactId>detekt-cli</artifactId>
<version>1.0.0.RC8</version>
</dependency>
</dependencies>
</plugin>
Then, I'm trying to execute it by the following command: mvn antrun:run#detekt
The result is the following:
$ mvn antrun:run#detekt
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------------< com.my:opd >--------------------------
[INFO] Building opd 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-antrun-plugin:1.3:run (detekt) # opd ---
[INFO] Executing tasks
[INFO] Executed tasks
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.295 s
[INFO] Finished at: 2018-08-10T11:46:02+03:00
[INFO] ------------------------------------------------------------------------
looks fine but the folder ${project.build.directory}/detekt-reports is not created and there are not any reports. What I did wrong?
I am not sure where is the issue however when detekt is executed through the maven tool in the intellij, it works fine. May be the problem in windows terminal...

Unresolved Dependencies errors When Trying To Build Apache Nutch 2.3.1

Its my first time to trying setting up and build apache nutch 2.3.1 based on this youtube tutorial on Windows 10 got Unresolved Dependencies errors like below:
D:\apachenutch>ant runtime
Buildfile: D:\apachenutch\build.xml
Trying to override old definition of task javac [taskdef] Could not load
definitions from resource org/sonar/ant/antlib.xml. It could not be
found.
ivy-probe-antlib:
ivy-download: [taskdef] Could not load definitions from resource
org/sonar/ant/antlib.xml. It could not be found.
ivy-download-unchecked:
ivy-init-antlib:
ivy-init:
init:
[mkdir] Created dir: D:\apachenutch\build
[mkdir] Created dir: D:\apachenutch\build\classes
[mkdir] Created dir: D:\apachenutch\build\release
[mkdir] Created dir: D:\apachenutch\build\test
[mkdir] Created dir: D:\apachenutch\build\test\classes
clean-lib:
resolve-default: [ivy:resolve] :: Apache Ivy 2.3.0 - 20130110142753 ::
http://ant.apache.org/ivy/ :: [ivy:resolve] :: loading settings ::
file = D:\apachenutch\ivy\ivysettings.xml [ivy:resolve] [ivy:resolve]
:: problems summary :: [ivy:resolve] :::: WARNINGS [ivy:resolve]
:::::::::::::::::::::::::::::::::::::::::::::: [ivy:resolve]
:: UNRESOLVED DEPENDENCIES :: [ivy:resolve]
:::::::::::::::::::::::::::::::::::::::::::::: [ivy:resolve]
:: org.apache.avro#avro;1.7.6: configuration not found in
org.apache.avro#avro;1.7.6: 'compile'. It was required from
org.apache.gora#gora-core;0.6.1 compile [ivy:resolve]
:::::::::::::::::::::::::::::::::::::::::::::: [ivy:resolve]
[ivy:resolve] [ivy:resolve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR
MORE DETAILS
BUILD FAILED D:\apachenutch\build.xml:468: impossible to resolve
dependencies:
resolve failed - see output for details
Total time: 14 seconds
D:\apachenutch>
I have been trying with "Ant Clean" command and "Ant Runtime" command still for many times not luck and got errors like above.
So how I can fix it?
All, I had the below error of 'unresolved dependencies', due to https: required after 1/15/20 under Maven. I was able to update both ivy.xml and ivysettings.xml with the correct https: reference, then errors under the build went away.
I hope the helps folks.
versions being used:
Nutch 2.3.1
Hbase 0.98.8
Solr 5.2.1
Java 7
Build error under ant:
[ivy:resolve] :: UNRESOLVED DEPENDENCIES ::
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve] :: org.apache.hbase#hbase-common;0.98.8-hadoop2: not found
[ivy:resolve] :: log4j#log4j;1.2.15: not found
[ivy:resolve] :: commons-io#commons-io;2.2: not found
[ivy:resolve] :: com.sun.xml.bind#jaxb-impl;2.1.12: not found
[ivy:resolve] :: com.sun.xml.bind#jaxb-impl;2.1.13: not found
[ivy:resolve] :: org.codehaus.jackson#jackson-core-asl;1.6.9: not found
[ivy:resolve] :: org.codehaus.jackson#jackson-mapper-asl;1.6.9: not found
[ivy:resolve] :: io.netty#netty;3.4.0.Final: not found
[ivy:resolve] :: commons-net#commons-net;2.2: not found
[ivy:resolve] :: log4j#log4j;1.2.16: not found
[ivy:resolve] :: commons-digester#commons-digester;1.7: not found
[ivy:resolve] :: org.apache.httpcomponents#httpcore;4.3.2: not found
[ivy:resolve] :: org.apache.hadoop#hadoop-yarn-common;2.2.0: not found
[ivy:resolve] :: org.apache.hadoop#hadoop-yarn-client;2.2.0: not found
[ivy:resolve] :: org.slf4j#slf4j-log4j12;1.6.6: not found
[ivy:resolve] :: org.apache.hadoop#hadoop-yarn-api;2.2.0: not found
[ivy:resolve] :: net.java.dev.jets3t#jets3t;0.7.1: not found
[ivy:resolve] :: asm#asm;3.1: not found
[ivy:resolve] :: org.apache.gora#gora-hbase;0.6.1: not found
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
Cannot reproduce your issue.
I was able to successfully compile the code, using the lastest 2.3.1 release candidate:
git clone https://github.com/apache/nutch.git
cd nutch
git checkout -b release-2.3.1rc2 release-2.3.1rc2
ant
Could I suggest that if you still have an problem you raise an issue against the project. You will need to quote which version you are trying to compile.
https://issues.apache.org/jira/browse/NUTCH
I was able to find a solution for this problem. In my case, I was able to fix it by changing all the http requests by https requests in the following files: ivy.xml, ivy-configurations.xml and ivysettings.xml

IVY resolver is looking in different local path

I have defined local cache as below :
<caches defaultCacheDir="${user.home}/.ivy2/local"
ivyPattern="[organization]/[module]/[module]-[revision]/[module]-[revision]-ivy.xml"
artifactPattern="[organization]/[module]/[module]-[revision]/[artifact].[ext]"/>
and trying to fetch data using resolver as
<resolvers>
<chain name="chain1" changingPattern=".*SNAPSHOT" returnFirst="true">
<resolver ref="local"/>
<ibiblio name="maven-repo1"
I have already all the jars in my local. But for a number of jars it is not able to find them as IVY is looking them in different path as below:
[ivy:resolve] module not found: org.apache.cxf#cxf-rt-core;2.2.+
[ivy:resolve] ==== local: tried
[ivy:resolve] C:\Users\psaha\.ivy2/local/org.apache.cxf/cxf-rt- core/[revision]/ivys/ivy.xml
[ivy:resolve] [ivydata-2.2.12.properties, ivydata-2.2.+.properties, cxf-rt-core-2.2.12]
[ivy:resolve] -- artifact org.apache.cxf#cxf-rt-core;2.2.+!cxf-rt-core.jar:
[ivy:resolve] C:\Users\psaha\.ivy2/local/org.apache.cxf/cxf-rt-core/[revision]/jars/cxf-rt-core.jar
[ivy:resolve] [ivydata-2.2.12.properties, ivydata-2.2.+.properties, cxf-rt-core-2.2.12]
[ivy:resolve] module not found: org.apache.cxf#cxf-rt-frontend-simple;2.2.+
[ivy:resolve] ==== local: tried
[ivy:resolve] C:\Users\psaha\.ivy2/local/org.apache.cxf/cxf-rt-frontend-simple/[revision]/ivys/ivy.xml
[ivy:resolve] [ivydata-2.2.12.properties, ivydata-2.2.+.properties, cxf-rt-frontend-simple-2.2.12]
[ivy:resolve] -- artifact org.apache.cxf#cxf-rt-frontend-simple;2.2.+!cxf-rt-frontend-simple.jar:
[ivy:resolve] C:\Users\psaha\.ivy2/local/org.apache.cxf/cxf-rt-frontend-simple/[revision]/jars/cxf-rt-frontend-simple.jar
[ivy:resolve] [ivydata-2.2.12.properties, ivydata-2.2.+.properties, cxf-rt-frontend-simple-2.2.12]
[ivy:resolve] module not found: org.apache.cxf#cxf-rt-frontend-jaxws;2.2.+
and ideally I do not want ivy to look into places like ../ivys/.. or ../jars/..
This is happening only for a couple of jar/ivy resolution. How to fix this issue?

ivy & server access errors

We have an Ivy repository accessible via HTTP. It can be accessed by several machines without problems but on a Windows machine we get a server access error.
[ivy:retrieve] Loading jar:file:/C:/Users/moserma/.ant/lib/ivy-2.3.0-rc1.jar!/org/apache/ivy/core/settings/ivy.properties
[ivy:retrieve] :: Apache Ivy 2.3.0-rc1 - 20120416000235 :: http://ant.apache.org/ivy/ ::
[ivy:retrieve] jakarta commons httpclient not found: using jdk url handling
[ivy:retrieve] :: loading settings :: file = D:\moserma\newWorkspace\Lakshmi\ivy\ivysettings.xml
[ivy:retrieve] no default ivy user dir defined: set to C:\Users\moserma\.ivy2
[ivy:retrieve] settings loaded (66ms)
[ivy:retrieve] default cache: D:\moserma\newWorkspace\Lakshmi\ivy\ivy-cache
[ivy:retrieve] default resolver: ETHZ-HTTP
[ivy:retrieve] -- 1 resolvers:
[ivy:retrieve] ETHZ-HTTP [url]
[ivy:retrieve] no resolved descriptor found: launching default resolve
Overriding previous definition of property "ivy.version"
[ivy:retrieve] using ivy parser to parse file:/D:/moserma/newWorkspace/Lakshmi/ivy.xml
[ivy:retrieve] :: resolving dependencies :: ch.ethz.wai#Lakshmi;1.0
[ivy:retrieve] confs: [default]
[ivy:retrieve] validate = true
[ivy:retrieve] refresh = false
[ivy:retrieve] resolving dependencies for configuration 'default'
[ivy:retrieve] == resolving dependencies for ch.ethz.wai#Lakshmi;1.0 [default]
[ivy:retrieve] == resolving dependencies ch.ethz.wai#Lakshmi;1.0->checkstyle#checkstyle-all;5.5 [default->*]
[ivy:retrieve] tried http://ivy.ethz.ch/checkstyle/checkstyle-all/5.5/ivy-5.5.xml
[ivy:retrieve] ERROR: Server access Error: Connection reset url=http://ivy.ethz.ch/checkstyle/checkstyle-all/5.5/ivy-5.5.xml
[ivy:retrieve] tried http://ivy.ethz.ch/checkstyle/checkstyle-all/5.5/checkstyle-all-5.5.jar
[ivy:retrieve] ERROR: Server access Error: Connection reset url=http://ivy.ethz.ch/checkstyle/checkstyle-all/5.5/checkstyle-all-5.5.jar
[ivy:retrieve] ETHZ-HTTP: no ivy file nor artifact found for checkstyle#checkstyle-all;5.5
[ivy:retrieve] WARN: module not found: checkstyle#checkstyle-all;5.5
[ivy:retrieve] WARN: ==== ETHZ-HTTP: tried
[ivy:retrieve] WARN: http://ivy.ethz.ch/checkstyle/checkstyle-all/5.5/ivy-5.5.xml
[ivy:retrieve] WARN: -- artifact checkstyle#checkstyle-all;5.5!checkstyle-all.jar:
[ivy:retrieve] WARN: http://ivy.ethz.ch/checkstyle/checkstyle-all/5.5/checkstyle-all-5.5.jar
Now there are no firewalls or proxies involved and the URLs are accessible without problems with other tools (e.g., a browser, curl, wget, ...). For example:
$ curl http://ivy.ethz.ch/checkstyle/checkstyle-all/5.5/ivy-5.5.xml
<ivy-module version="2.0">
<info organisation="checkstyle" module="checkstyle-all" revision="5.5" status="integration" publication="20120806133612"/>
<publications>
<artifact name="checkstyle-all" type="jar" ext="jar"/>
</publications>
</ivy-module>
On the server side the logs show nothing: no errors not even a connection
EDIT ivysettings.xml should be OK since they can be used without problems with Mac OS X and Linux:
<ivysettings>
<settings defaultResolver = "ETHZ-HTTP" >
<caches defaultCacheDir = "${ivy.settings.dir}/ivy-cache" />
</settings>
<resolvers>
<url name="ETHZ-HTTP">
<ivy pattern="http://ivy.ethz.ch/[organisation]/[module]/[revision]/[artifact]-[revision].xml" />
<artifact pattern="http://ivy.ethz.ch/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>
</resolvers>
</ivysettings>
Any hint?
Maybe there is a firewall on your Windows machine which is blocking Java from doing any network ?
Try this simple ant build.xml file to test it:
<project>
<get src="http://ivy.ethz.ch/checkstyle/checkstyle-all/5.5/ivy-5.5.xml" dest="ivy-5.5.xml" />
</project>