Maven Build Failure due Plugin Dependency - maven

I've read the following previous answers to similar topics, but none have worked for me.
Here is what I've tried:
Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved
Maven Build Failure - failure to find plugins
The first link doesn't really apply because I'm not using a proxy, but I did check the settings.xml file for other possibilities. I can download directly by going to the plugin .jar file.
The second link might apply, but I have no idea what they mean by: "change user settings to point out to correct settings.xml and to your repository folder should exist in your system." I don't know how to do this and am not sure which repository they are referring to and how I find out. I'm looking only at my Maven settings.xml file.
So here's my errors
C:\cas-overlay-template-master>mvn package install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building cas-overlay 1.0
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.965 s
[INFO] Finished at: 2017-03-21T23:42:13-04:00
[INFO] Final Memory: 7M/97M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-compiler-plugin:3.3 or one of its dependencies could not be resolved: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:jar:3.3 from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [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/PluginResolutionException
My goal is to get CAS 5.0.4 working for a Liferay 7.0ga3, running Tomcat 8, JDK 1.8, and Maven 3. I am a student, have never used any of these technologies except JDK 1.8, so I really need very understandable answers. Not veteran answers for those that should know what they are doing. Thanks

The actual problem here is around the certificates the Maven JVM is trusting:
Unexpected error: java.security.InvalidAlgorithmParameterException:
the trustAnchors parameter must be non-empty
Various things can fix it, but this question has a lot of solutions (and one more here).

Related

How to deploy to Nexus Sonatype new Maven module

I'm creating new module for existing Maven project. When I try to mvn:install project from Idea it throughs these error:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for kz.alfabank:type-ortalyk-bazar:bundle:1.0
[WARNING] 'version' contains an expression but should be a constant. # kz.alfabank:type-ortalyk-bazar:${kz.alfabank.type.ortalyk-bazar.version}, C:\Users\u8002\Documents\dev\alfa-bank\kz.alfabank.soa\kz.alfabank.soa\type-ortalyk-bazar\pom.xml, line 19, column 14
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building type-ortalyk-bazar 1.0
[INFO] ------------------------------------------------------------------------
Downloading: http://vserver266:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-surefire-plugin/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-surefire-plugin/maven-metadata.xml from/to public (http://vserver266:8081/nexus/content/groups/public): Failed to transfer file: http://vserver266:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-surefire-plugin/maven-metadata.xml. Return code is: 504 , ReasonPhrase:Connection Timed Out.
Downloading: http://vserver266:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-install-plugin/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-install-plugin/maven-metadata.xml from/to public (http://vserver266:8081/nexus/content/groups/public): Failed to transfer file: http://vserver266:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-install-plugin/maven-metadata.xml. Return code is: 504 , ReasonPhrase:Connection Timed Out.
Downloading: http://vserver266:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-deploy-plugin/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-deploy-plugin/maven-metadata.xml from/to public (http://vserver266:8081/nexus/content/groups/public): Failed to transfer file: http://vserver266:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-deploy-plugin/maven-metadata.xml. Return code is: 504 , ReasonPhrase:Connection Timed Out.
Downloading: http://vserver266:8081/nexus/content/groups/public/kz/alfabank/type-ortalyk-bazar/1.0/type-ortalyk-bazar-1.0.jar
Downloading: https://repo.maven.apache.org/maven2/kz/alfabank/type-ortalyk-bazar/1.0/type-ortalyk-bazar-1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:03 min
[INFO] Finished at: 2018-10-11T14:01:00+06:00
[INFO] Final Memory: 14M/167M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project type-ortalyk-bazar: Could not resolve dependencies for project kz.alfabank:type-ortalyk-bazar:bundle:1.0: Could not find artifact kz.alfabank:type-ortalyk-bazar:jar:1.0 in public (http://vserver266:8081/nexus/content/groups/public) -> [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
We use as a repository Sonatype Nexus 2.11.4. Why Maven looks for newly created module in Nexus repository? And seems that some metadata files cannot be downloaded from Nexus :/
If dependencies are not available in local repository or other dependencies are not built or downloaded prior to the current module build that is when it looks within the remote repositories.
Please do look for the artifact kz.alfabank:type-ortalyk-bazar:jar:1.0 is present in the in your .m2 repo
Note: If you are using IntelliJ within the setting try offline mode

maven dependency versionioning issue

I am trying to add the dependency as below to use the version mentioned or the latest.I am expecting maven to take the dependencies with version >= 0.0.1 but maven is failing to resolve the dependencies.If i mention the exact version the dependencies are getting downloaded.
Iam using maven 3.5
<dependency>
<groupId>com.company.esb.fuse</groupId>
<artifactId>common</artifactId>
<version>[0.0.1,)</version>
<scope>provided</scope>
</dependency>
maven logs:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building source out Write 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.401 s
[INFO] Finished at: 2018-01-22T17:26:21+01:00
[INFO] Final Memory: 14M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project source: Could not resolve dependencies for project com.company.esb.source.out:source:war:0.0.1-SNAPSHOT: Failed to collect dependencies at com.company.esb.fuse:common:jar:[0.0.1,): No versions available for com.company.esb.fuse:common:jar:[0.0.1,) within specified range -> [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
Above details are not sufficient to determine the exact problem. But according to your maven logs,
No versions available for com.company.esb.fuse:common:jar:[0.0.1,)
Note that it says com.company, not com.compant as you typed in this question.
check your pom.xml first and put correct groupId.
If you are still getting the same error, check your local .m2 folder and confirm that you have at least one artifact with a version which is in the declared range.
UPDATE : the error may be in the maven-metadata file. check maven-metadata-local.xml file placed inside .m2/repository/com/company/esb/fuse/common. All versions should be there under <versions> tag.

Every build fails in maven

C:\Users\saurabh_kumar>cd C:\Users\saurabh_kumar\Desktop\github\MoviePoll\MoviePoll
C:\Users\saurabh_kumar\Desktop\github\MoviePoll\MoviePoll>mvn clean
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MoviePoll 1.0.0-BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin
/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.593 s
[INFO] Finished at: 2015-12-29T18:39:11+05:30
[INFO] Final Memory: 14M/89M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies cou
ld not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-cle
an-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:po
m:2.5 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.Validato
rException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderExcep
tion: unable to find valid certification path to requested target -> [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 followi
ng articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
C:\Users\saurabh_kumar\Desktop\github\MoviePoll\MoviePoll>
i am trying to build a java application ,but i am getting this error not with this but with every build.I found few solutions like deleting everything in .m2 folder but that also couldn't resolve this issue.
You haven't set up Maven to use SSL. Either switch to http:// (instead of https://), or have a look at this page. You need to import the certificates and then set up your MAVEN_OPTS accordingly.

How to Resolve Maven CDK Plugin Dependency Error when Following Cloudera Demo

I'm trying to following along with the Cloudera CDK-examples Demo (https://github.com/cloudera/cdk-examples/tree/master/demo); this is part of a conference (Big Data Techon 2013) session by Cloudera on Hadoop App development
However, I am unable to get mvn install to build successfully. I keep getting warnings like this
[WARNING] The POM for com.cloudera.cdk:cdk-maven-plugin:jar:0.8.1-SNAPSHOT is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for com.cloudera.cdk:cdk-maven-plugin:0.8.1-SNAPSHOT: Plugin com.cloudera.cdk:cdk-maven-plugin:0.8.1-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for com.cloudera.cdk:cdk-maven-plugin:jar:0.8.1-SNAPSHOT
and then it fails with these errors... I tried to troubleshoot on my own using Google and the link mentioned in the error, but it was to no avail
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.263s
[INFO] Finished at: Tue Oct 15 15:21:23 PDT 2013
[INFO] Final Memory: 6M/57M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'cdk' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/cloudera/.m2/repository), cdh.repo (https://repository.cloudera.com/artifactory/cloudera-repos), central (http://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/NoPluginFoundForPrefixException
Looking at the pom.xml here, I see that the snapshots is disabled for both repository and pluginRepository.
You could try to enable it and try building.

build failure in dyn.js

Today I tried to build dyn.js from source with the instructions on https://github.com/dynjs/dynjs.
I tried it on Windows 7 and Linux (Fedora), but on both systems the build fails.
This is what i get:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building dynjs 0.1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.projectodd.rephract:rephract:jar:1.x.incremental.39 is missing, no dependency information available
[WARNING] The POM for org.jboss.jreadline:jreadline:jar:0.20.incremental.2 is missing, no dependency information available
[WARNING] The POM for org.jruby.joni:joni:jar:1.1.10.incremental.1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.382s
[INFO] Finished at: Wed Mar 20 12:01:04 CET 2013
[INFO] Final Memory: 7M/109M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project dynjs: Could not resolve dependencies for project org.dynjs:dynjs:jar:0.1.0-SNAPSHOT: The following artifacts could not be resolved: org.projectodd.rephract:rephract:jar:1.x.incremental.39, org.jboss.jreadline:jreadline:jar:0.20.incremental.2, org.jruby.joni:joni:jar:1.1.10.incremental.1: Failure to find org.projectodd.rephract:rephract:jar:1.x.incremental.39 in http://repo.maven.apache.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 -> [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
Does anyone know how to fix this or how to get a working version of dyn.js?
Thanks!
The version # for that dependency has just been updated, see here:
https://github.com/dynjs/dynjs/blob/master/pom.xml#L144
so if you pull the repo, it should fix that and here is a link to the 0.1.1 tag
https://github.com/dynjs/dynjs/tree/v0.1.1
Once the sonatype ends its maintenance, 0.1.1 should be released in central
-Luke

Resources