Maven dependency issue in Mule project - maven

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.

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.

maven can't download jar from nexus

There are some mistanken
[ERROR] Failed to execute goal on project vinsuan-road-platform-comm: Could not resolve dependencies for project com.vinsuan.road.paltform:vinsuan-road-platform-comm:jar:1.0-SNAPSHOT: Failed to collect dependencies at com.vinsuan4cloud:vinsuan-common-core:jar:1.0.0: Failed to read artifact descriptor for com.vinsuan4cloud:vinsuan-common-core:jar:1.0.0: Failure to find com.vinsuan4cloud:vinsuan:pom:1.0.0 in http://xxx.xxx.xxx.xxx:9981/repository/sps_group/ was cached in the local repository, resolution will not be reattempted until the update interval of sps_group has elapsed or updates are forced -> [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 <goals> -rf :vinsuan-road-platform-comm`enter code here`
http://xxx.xxx.xxx.xxx:9981 is out company nexus url,So i'am sorry。
then i found some similar problems,their answer are version not match,however,vinsuan-common-core.jar only one version,So i don't know what,i use some operations,such as clean 、compile、install、mvn dependeny:sources,but ide point the mistaken。
The error says Failure to find com.vinsuan4cloud:vinsuan:pom:1.0.0. There should be a pom file beside the jar in the repo in order maven will able to resolve the dependency

Using the parameter "LATEST' while building the project does not work with "mvn clean install"

If we use the 'LATEST' parameter when generating the project, the command 'mvn clean install' errors out. Should this parameter be used or should the latest version be provided in the command?
mvn archetype:generate "-DarchetypeGroupId=com.sap.cloud.s4hana.archetypes" "-DarchetypeArtifactId=scp-cf-tomee" **"-DarchetypeVersion=LATEST**" "-DgroupId=com.sap.cloud.s4hana.examples" "-DartifactId=my-app" "-Dversion=1.0-SNAPSHOT"
Error is
Error:
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/springframework/spring-framework-bom/5.1.1.RELEASE/spring-framework-bom-5.1.1.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework:spring-framework-bom:pom:5.1.1.RELEASE from/to central (https://repo.maven.apache.org/maven2): proxy.myproxy.corp # com.sap.cloud.s4hana:sdk-bom:2.7.1-SNAPSHOT, C:\Users\xxxxxxx\.m2\repository\com\sap\cloud\s4hana\sdk-bom\2.7.1-SNAPSHOT\sdk-bom-2.7.1-SNAPSHOT.pom, line 994, column 25
#[ERROR] The build could not read 1 project -> [Help 1]
[ERROR][ERROR] The project com.sap.cloud.s4hana.examples:address-manager1:1.0-SNAPSHOT (C:\my-app\pom.xml) has 1 error
[ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework:spring-framework-bom:pom:5.1.1.RELEASE from/to central (https://repo.maven.apache.org/maven2): proxy.wdf.sap.corp # com.sap.cloud.s4hana:sdk-bom:2.7.1-SNAPSHOT, C:\Users\xxxxxx\.m2\repository\com\sap\cloud\s4hana\sdk-bom\2.7.1-SNAPSHOT\sdk-bom-2.7.1-SNAPSHOT.pom, line 994, column 25: Unknown host proxy.myproxy.corp -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
The version 2.7.1-SNAPSHOT in not a released version. It is not available externally (maven-central). So, you cannot download it from maven central. However, 2.6.1 is available. That is why it works.
Please try with RELEASE instead of LATEST or better use released versions directly.
Please also check that settings.xml does not point to an internal snapshot nexus server and delete the local repository in your .m2 directory.
Have you checked your network configuration?
I can see a proxy and unknown host error in the log.

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

Manual dependency Maven and Jenkins

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:).

Resources