I have a created a maven repo in a directory called lib in the base of my project.
I can use maven to build this project and fetch dependencies from the repo in the lib directory. When I try to build this project with Hudson, Hudson can not find the dependencies in the lib repo.
Here are the relevant parts of the project pom:
<dependency>
<groupId>manitou</groupId>
<artifactId>manitou.cxf.jar</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>ErpClientsLibRepo</id>
<url>file://${basedir}/lib</url>
</repository>
</repositories>
Here are the errors from Maven when ran from Hudson:
[INFO] o.h.m.e.h.MavenExecutionResultHandler - Build failed with exception(s)
[INFO] o.h.m.e.h.MavenExecutionResultHandler - [1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project DigabitERPClients: Could not resolve dependencies for project com.digabit:DigabitERPClients:jar:1.2.0: Failure to find manitou:manitou.cxf.jar:jar:1.0.0 in file:///opt/eng/hudson/jobs/20-DigabitJParent/workspace/DigabitErpClients/lib was cached in the local repository, resolution will not be reattempted until the update interval of ErpClientsLibRepo has elapsed or updates are forced
[DEBUG] Closing connection to remote
[ERROR] Failed to execute goal on project DigabitERPClients: Could not resolve dependencies for project com.digabit:DigabitERPClients:jar:1.2.0: Failure to find manitou:manitou.cxf.jar:jar:1.0.0 in file:///opt/eng/hudson/jobs/20-DigabitJParent/workspace/DigabitErpClients/lib was cached in the local repository, resolution will not be reattempted until the update interval of ErpClientsLibRepo has elapsed or updates are forced -> [Help 1]
Here is a dir listing at the path Maven (As ran by Hudson) seems to be looking at:
[root#vail lib]# cd /opt/eng/hudson/jobs/20-DigabitJParent/workspace/DigabitErpClients/lib
[root#vail lib]# ls
manitou
[root#vail lib]# ls manitou/
manitou.cxf.jar
[root#vail lib]#
Any ideas what I'm doing wrong? Thanks
I went into the hudson project and forced maven to update, now the build works :S
Related
I working on converting a project from ant to maven and am getting errors trying to pull in jars from geomajas.
I am not behind a firewall and the dependencies from maven central are downloading. I have also added geomajas to the repositories in my projects pom.xml.
Below are the relevant portions from the pom.xml and the error I am getting.
If I instead define the jar dependency with a system path to a local copy of the jar the project builds successfully.
<dependency>
<groupId>org.lobobrowser</groupId>
<artifactId>cobra</artifactId>
<version>0.98.4</version>
</dependency>
.....
<repository>
<id>geomajas</id>
<name>Geomajas Maven Repository</name>
<url>https://maven.geomajas.org/(https://maven.geomajas.org/)</url>
</repository>
[ERROR] Failed to execute goal on project niksun-services-util: Could not resolve dependencies for project com.niksun:niksun-services-util:jar:main: Failed to collect dependencies at org.lobobrowser:cobra:jar:0.98.4: Failed to read artifact descriptor for org.lobobrowser:cobra:jar:0.98.4: Could not transfer artifact org.lobobrowser:cobra:pom:0.98.4 from/to geomajas (http://maven.geomajas.org/(http://maven.geomajas.org/)): connect timed out -> [Help 1]
What is the correct way to add dependency in Intelli?
I have added
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
to pom.xml but I got the error
Failed to execute goal on project accessing-data-mysql: Could not resolve dependencies for project com.e
xample:accessing-data-mysql:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at org.springframework.boot:sprin
g-boot-configuration-processor:jar:2.4.7: Failed to read artifact descriptor for org.springframework.boot:spring
-boot-configuration-processor:jar:2.4.7: Could not transfer artifact org.springframework.boot:spring-boot-config
uration-processor:pom:2.4.7 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://
repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-configuration-processor/2.4.7/spring-boot-conf
iguration-processor-2.4.7.pom: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParam
eterException: the trustAnchors parameter must be non-empty -> [Help 1]
when I do mvn install. I have try maven->reload project and it still didn't work. Any idea on how to solve the problem?
After a failed attempt, maven will leave a small file in your local .m2 repository that will prevent any attempt to re-download the file unless the update interval has elapsed or you force the updates using the maven -U switch described in other answers.
Just delete the folder for that artifact in your local m2 repository and update you project; a new download attempt will trigger.
rm -rf ~/.m2
Version: maven 3.6.3
I try to put this dependency into pom.xml,but it not auto download
<dependency>
<groupId>com.datastax.spark</groupId>
<artifactId>spark-cassandra-connector_2.11</artifactId>
<version>2.4.3</version>
</dependency>
so i use command line:
mvn dependency:get -DremoteRepositories=http://repo1.maven.org/maven2 -DgroupId=com.datastax.spark -DartifactId=spark-cassandra-connector_2.11 -Dversion=2.4.3 -Dtransitive=false
but it give me couldn't download artifact error log :
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:get (default-cli) on project standalone-pom: Couldn't download artifact: Could not transfer artifact com.datastax.spark:spark-cassandra-connector_2.11:jar:2.4.3
Do I need to upgrade remoteRepositories?
Why are some commonly used packages automatically downloaded quickly ? such as guava,commons-lang.
Some new versions are always problematic to rely on for download,Is it no cache in
repository?
How can I download the dependency? Thanks
How do I stop the online searching by maven m2e connectors for the dependencies when I have already overridden the functionality for them to have local library instead of central by pom file by giving url like :
<repository>
<id>central</id>
<url>file://${basedir}/library</url>
</repository>
My all other files get downloaded(I mean copied) from the library which exists at local except some which I have not included in the library. Is there any way that connector too only search for the local library. My log is something like below.
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------
[INFO] Total time: 5.413 s
[INFO] Finished at: 2017-09-18T15:22:36-05:00
[INFO] Final Memory: 12M/125M
[INFO] ------------------------------------------------------------------
------
[ERROR] Failed to execute goal on project myproject: Could not resolve
dependencies for project com.company.product:myproject:jar:1.0: Failed to
collect dependencies at org.glassfish.jersey.media:jersey-media-json-
jackson:jar:2.19 -> com.fasterxml.jackson.jaxrs:jackson-jaxrs-
base:jar:2.5.1 -> com.fasterxml.jackson.core:jackson-core:jar:2.5.1:
Failed to read artifact descriptor for
com.fasterxml.jackson.core:jackson-core:jar:2.5.1: Could not transfer
artifact com.fasterxml.jackson.core:jackson-core:pom:2.5.1 from/to
release.maven.java.net (https://maven.java.net/content/groups/public):
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target -> [Help 1]
[ERROR]
Here I am running package as a goal. I can provide more details if you ask.
Quite simple, ask your central repository to get redirected to local repository in your settings.xml file. Example given below. Let me know if further help required.
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
...
<mirrors>
<mirror>
<id>central-repo</id>
<name>Local repo</name>
<url>http://<localhost>/central</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
...
</settings>
You can try -o option (offline).
Example command line:
mvn clean package -o
I have a maven project with an in-project repository with an external jar file.
I used the install command to install the jar file into the in-porject repository
and when I checked in the repository the jar file was installed
i also added the dependency configuration in the pom file.
But when I run the mvn compile file.
I get the error that mvn cannot resolve the dependency
this is the Pom snippet:
<repository>
<id>repo</id>
<releases>
<enabled>true</enabled>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>file://${project.basedir}/repo</url>
</repository>
this is the dependency in POM
<dependency>
<groupId>Com.RubineEngine.GesturePoints</groupId>
<artifactId>Com-RubineEngine-GesturePoints</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
this is the error message :
[INFO] Final Memory: 6M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project com-boundingbox-box: Could not resolve
dependencies for project com.boundingbox.box:com-boundingbox-box:jar:1.0-SNAPSH
OT: Could not find artifact Com.RubineEngine.GesturePoints:Com-RubineEngine-Gest
urePoints:jar:1.0-SNAPSHOT -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
lutionException
Does anybody have any suggestion about this error.
this is the error message after using the U and X switches
[DEBUG] =======================================================================
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for file://C:\U
sers\FAISAL\Desktop\disaster\com-initialtheta-theta/repo
Downloading: file://C:\Users\FAISAL\Desktop\disaster\com-initialtheta-theta/repo
/Com/RubineEngine/GesturePoints/Com-RubineEngine-GesturePoints/1.0-SNAPSHOT/mave
n-metadata.xml
[DEBUG] Writing resolution tracking file C:\Users\FAISAL\.m2\repository\Com\Rubi
neEngine\GesturePoints\Com-RubineEngine-GesturePoints\1.0-SNAPSHOT\resolver-stat
us.properties
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://repo
.typesafe.com/typesafe/releases/
Downloading: http://repo.typesafe.com/typesafe/releases/Com/RubineEngine/Gesture
Points/Com-RubineEngine-GesturePoints/1.0-SNAPSHOT/maven-metadata.xml
[DEBUG] Writing resolution tracking file C:\Users\FAISAL\.m2\repository\Com\Rubi
neEngine\GesturePoints\Com-RubineEngine-GesturePoints\1.0-SNAPSHOT\resolver-stat
us.properties
[DEBUG] Could not find metadata Com.RubineEngine.GesturePoints:Com-RubineEngine-
GesturePoints:1.0-SNAPSHOT/maven-metadata.xml in typesafe (http://repo.typesafe.
com/typesafe/releases/)
[DEBUG] Could not find metadata Com.RubineEngine.GesturePoints:Com-RubineEngine-
GesturePoints:1.0-SNAPSHOT/maven-metadata.xml in lib (file://C:\Users\FAISAL\Des
ktop\disaster\com-initialtheta-theta/repo)
[DEBUG] Skipped remote update check for Com.RubineEngine.GesturePoints:Com-Rubin
eEngine-GesturePoints:1.0-SNAPSHOT/maven-metadata.xml, already updated during th
is session.
[DEBUG] Failure to find Com.RubineEngine.GesturePoints:Com-RubineEngine-GestureP
oints:1.0-SNAPSHOT/maven-metadata.xml in http://repo.typesafe.com/typesafe/relea
ses/ was cached in the local repository, resolution will not be reattempted unti
l the update interval of typesafe has elapsed or updates are forced
[DEBUG] Skipped remote update check for Com.RubineEngine.GesturePoints:Com-Rubin
eEngine-GesturePoints:1.0-SNAPSHOT/maven-metadata.xml, already updated during th
is session.
[DEBUG] Failure to find Com.RubineEngine.GesturePoints:Com-RubineEngine-GestureP
oints:1.0-SNAPSHOT/maven-metadata.xml in file://C:\Users\FAISAL\Desktop\disaster
\com-initialtheta-theta/repo was cached in the local repository, resolution will
not be reattempted until the update interval of lib has elapsed or updates are
forced
Looks like the system is getting confuse between two repositories.
Check, if the groupId/artifactId are set correctly in the pom file of the libs in your project's repository (i.e. ${project.baseDir}\repo\Com....\1.0-SNAPSHOT\Com-RubineEngine-GesturePoints.pom)
To get rid of "resolution will not be reattempted until the update interval of lib has elapsed or updates are forced" error you need to delete the folders from your local repository (usually ~/.m2), i.e. ~/.m2/Com/RubineEngine.
Try changing snapshots enabled to true.
<snapshots>
<enabled>true</enabled>
</snapshots>