Manual dependency Maven and Jenkins - maven

I have created a Job in Jenkins with some goals in Maven (clean verify compile).
But, when I run the Job has the error:
[ERROR] Failed to execute goal on project NameProject: Could not resolve dependencies for project NameProject:x:war:0.0.1-SNAPSHOT: The following artifacts could not be resolved: com.oracle:ojdbc14:jar:10.2.0.5, org.primefaces.themes:sentinel-theme:jar:2.1.2: Could not find artifact com.oracle:ojdbc14:jar:10.2.0.5 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
I have created manual dependency in Maven
mvn install:install-file
-Dfile=<path-to-file>
-DgroupId=<group-id>
-DartifactId=<artifact-id>
-Dversion=<version>
-Dpackaging=<packaging>
-DgeneratePom=true
,but Jenkins doesn't know this dependency in the pom.
When I execute verify compile in Maven it's works!, But when I execute in Jenkins doesn't work.

If you want to install it into a local repository, you need to install it into the local repository that is used by the Jenkins Server,i.e. you need to start mvn install on the Jenkins server.
If you have a company Nexus server, it is probably better to install it there.

I have changed the default local repository Maven
<localRepository>C:/Users/nameUser/.m2/repository</localRepository>
My Maven diretory was in a another drive (E:/), when repository in (C:).

Related

How to solve the dependencies of building ignite 2.8 source code?

I am trying to build ignite 2.8 in windows 10, my java version is 1.8, and maven 3.8.5.
I build source code with the command below:
mvn clean install -P all-java,all-scala,licenses -DskipTests -D maven.javadoc.skip=true.
It failed and showed that:
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project ignite-jta: Could not resolve dependencies for project org.apache.ignite:ignite-jta:jar:2.8.0: Failed to collect dependencies at org.ow2.jotm:jotm-core:jar:2.2.3 -> org.ow2.carol:carol:jar:3.0.8 -> org.jacorb:jacorb:jar:2.2.3-jonas-patch-20071018: Failed to read artifact descriptor for org.jacorb:jacorb:jar:2.2.3-jonas-patch-20071018: Could not transfer artifact org.jacorb:jacorb:pom:2.2.3-jonas-patch-20071018 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [apache.snapshots (http://repository.apache.org/snapshots, default, snapshots), ow2-snapshot (http://repository.ow2.org/nexus/content/repositories/snapshots, default, snapshots), ow2 (http://maven.ow2.org/maven2, default, releases)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :ignite-jta
I have checked that the jar file of org.jacorb:jacorb:pom:2.2.3-jonas-patch-20071018 is no longer maintained in maven central and i cannot find its backup anywhere. I am not sure how to deal with that.

How can I download a specific Maven artifact from repository to local drive?

There might be some times that we want to download a specific Maven artifact from repository to local drive.
In my case, I would like to use a third party library published in Maven repository in a particular IDE. However, the IDE I use has no integration support for maven repository yet, therefore the only way to use this library is to download the artifact to my local drive.
I'm a newbie for maven, any suggestions will be very appreciated. Thanks.
-----UPDATE------
I learned from other threads and realised I should use maven dependency plugin to download an artifact to local folder. In my case, I need to download google ARCore from maven repository. I search the ARCore at maven repository, and know that:
Category: com.google.ar, Group:core, version:1.1.0
So I used the following command line to download it:
mvn dependency:get -Dartifact=com.google.ar:core:1.1.0
However, it failed to download the artifact, the error message is like:
[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: Missing:
[ERROR] ----------
[ERROR] 1) com.google.ar:core:jar:1.1.0
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=com.google.ar -DartifactId=core -Dversion=1.1.0 -Dpackaging=jar -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=com.google.ar -DartifactId=core -Dversion=1.1.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR] Path to dependency:
[ERROR] 1) org.apache.maven.plugins:maven-downloader-plugin:jar:1.0
[ERROR] 2) com.google.ar:core:jar:1.1.0
[ERROR]
[ERROR] ----------
[ERROR] 1 required artifact is missing.
Anyone can give a help? Thanks.
If you look at the documentation of the artifact option though:
A string of the form groupId:artifactId:version[:packaging][:classifier].
Look at its last (optional) token, [:classifier]. I think That is what you are missing.
try this one,
mvn dependency:get -Dartifact=com.google.ar:core:1.1.0:jar:jar-with-dependencies

Maven dependency issue in Mule project

I'm not able to find this particular maven dependency while creating new Maven support enabled project in AnypointStudio. Same issue comes when I try to mavenize an existing Mule project. Has anyone solved this?
Anypoint Studio version - 5.4.3
Mule runtime version - 3.6.1
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.4:copy (copy-clover-plugins) on project tradeshift-connector: Unable to find artifact. Failure to find com.cloveretl:cloveretl-engine:zip:3.6.1 in http://repo1.maven.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of Central has elapsed or updates are forced
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=com.cloveretl -DartifactId=cloveretl-engine -Dversion=3.6.1 -Dpackaging=zip -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=com.cloveretl -DartifactId=cloveretl-engine -Dversion=3.6.1 -Dpackaging=zip -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR]
[ERROR] com.cloveretl:cloveretl-engine:zip:3.6.1
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] Central (http://repo1.maven.org/maven2/, releases=true, snapshots=true),
[ERROR] mulesoft-releases (http://repository.mulesoft.org/releases/, releases=true, snapshots=true),
[ERROR] central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)
Go to your local M2_REPO folder and delete contents of /com/cloveretl. That will force Maven to pull it again.
Go to your local .m2 repo and delete the contents of /com/cloveretl, as others have suggested.
Mule recreates the folder correctly but the ZIP file is called cloveretl-engine-3.6.1.zip.lastupdated.
Rename to cloveretl-engine-3.6.1.zip and it works fine.

Maven says archetype does not exist

I am trying to create a JPA based project using Maven and eclipse. I tried using the jpa-maven-archetype from create new maven project in the eclipse project creation, but it shot back this error
Could not resolve archetype com.rfc.maven.archetypes:jpa-maven-archetype:RELEASE from any of the configured repositories.
Could not resolve artifact com.rfc.maven.archetypes:jpa-maven-archetype:pom:RELEASE
Failed to resolve version for com.rfc.maven.archetypes:jpa-maven-archetype:pom:RELEASE: Could not find metadata com.rfc.maven.archetypes:jpa-maven-archetype/maven-metadata.xml in local (/home/sebastian/.m2/repository)
Failed to resolve version for com.rfc.maven.archetypes:jpa-maven-archetype:pom:RELEASE: Could not find metadata com.rfc.maven.archetypes:jpa-maven-archetype/maven-metadata.xml in local (/home/sebastian/.m2/repository)
Basically the eclipse plugin is looking into my local repositories instead of remote ones. So I tried going the command line and explicitly specifying the remote repository with the following command
mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create \
-DgroupId=com.something -DartifactId=jpaexample \
-DarchetypeArtifactId=jpa-maven-archetype \
-DarchetypeVersion=RELEASE \
-DremoteRepositories=http://maven.rodcoffin.com/repo \
-DinteractiveMode=false
And I got this error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create (default-cli) on project standalone-pom: Error creating from archetype: Error attempting to download archetype. Error downloading. Failed to resolve version for org.apache.maven.archetypes:jpa-maven-archetype:jar:RELEASE: Could not find metadata org.apache.maven.archetypes:jpa-maven-archetype/maven-metadata.xml in local (/home/sebastian/.m2/repository)
[ERROR] org.apache.maven.archetypes:jpa-maven-archetype:jar:RELEASE
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] id0 (http://maven.rodcoffin.com/repo, releases=true, snapshots=true)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
It seems that repo maven.rodcoffin.com/repo is not working, or there is something wrong with my maven setup. I am not sure which one, if some one could give me pointers on where to search for, that would be helpful.
Also if repo maven.rodcoffin.com/repo is not working. What are my other options to create a JPA archetype project. Do I have to make a simple maven project and then convert it to a JPA as shown here.
EDIT: I just weaseled out of the problem by creating a maven quick type achetype and then using the persistence.xml for my project.
So just ignore this question.

maven project running problem

How To resulve this problem
i have update my java version to java6u23 but it will still create problem so what should i do
i dont know much more about maven
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MultipleArtifactsNotFoundException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :mediaPlayer
You appear to be missing a dependency for jna-3.2.4
This isn't available on the central maven repo http://repo1.maven.org/maven2/net/java/dev/jna/jna/
But you can find it in the java.net repo http://download.java.net/maven/2/net/java/dev/jna/jna/3.2.4/
Make sure that you have the java.net repo defined to your maven build.
This can be done iether in your pom, or in the settings.xml in your user home/.m2 directory.

Resources