I can't get cas overlay build with jdbc dependency - jdbc

After successfully building cas overlay for v5.3.9 with static authentication, after adding the dependency for jdbc the build fails.
The only difference from the basic build is adding the dependency to pom.xml (as per the documentation):
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-jdbc</artifactId>
<version>${cas.version}</version>
</dependency>
There is no indication in the documentation that I should need any authorization to access repository contents
Maven build results as follows:
/NetBeansProjects/cas-overlay-template-5.3; JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home M2_HOME=/opt/apache-maven-3.6.1 /opt/apache-maven-3.6.1/bin/mvn clean install
Scanning for projects...
---------------------< org.apereo.cas:cas-overlay >---------------------
Building cas-overlay 1.0
--------------------------------[ war ]---------------------------------
Downloading from shibboleth-releases: https://build.shibboleth.net/nexus/content/repositories/releases/net/shibboleth/tool/xmlsectool/2.0.0/xmlsectool-2.0.0.pom
Downloading from shib-release: https://build.shibboleth.net/nexus/content/repositories/releases/net/shibboleth/tool/xmlsectool/2.0.0/xmlsectool-2.0.0.pom
Downloading from shib-release: https://build.shibboleth.net/nexus/content/repositories/releases/com/nimbusds/lang-tag/maven-metadata.xml
Downloading from shibboleth-releases: https://build.shibboleth.net/nexus/content/repositories/releases/com/nimbusds/lang-tag/maven-metadata.xml
Could not transfer metadata com.nimbusds:lang-tag/maven-metadata.xml from/to shibboleth-releases (https://build.shibboleth.net/nexus/content/repositories/releases): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Could not transfer metadata com.nimbusds:lang-tag/maven-metadata.xml from/to shib-release (https://build.shibboleth.net/nexus/content/repositories/releases): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Failed to execute goal on project cas-overlay: Could not resolve dependencies for project org.apereo.cas:cas-overlay:war:1.0: Failed to collect dependencies at org.apereo.cas:cas-server-support-jdbc:jar:5.3.9 -> org.apereo.cas:cas-server-core-authentication-api:jar:5.3.9 -> org.apereo.cas:cas-server-core-api-events:jar:5.3.9 -> org.apereo.cas:cas-server-core-util-api:jar:5.3.9 -> org.pac4j:pac4j-saml:jar:3.6.1 -> net.shibboleth.tool:xmlsectool:jar:2.0.0: Failed to read artifact descriptor for net.shibboleth.tool:xmlsectool:jar:2.0.0: Could not transfer artifact net.shibboleth.tool:xmlsectool:pom:2.0.0 from/to shibboleth-releases (https://build.shibboleth.net/nexus/content/repositories/releases): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]

Related

Error running PuppyCrawl's Maven Checkstyle Plugin

Well, I'm trying to configure Maven's Checkstyle Plugin on the project I'm currently working on and I'm getting the following:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (verify-style) on project email: Failed during checkstyle execution: Failed during checkstyle configuration: unable to parse configuration stream: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
So, running mvn install -X I've got the following stacktrace:
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
at sun.security.validator.Validator.validate(Validator.java:260)
at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1491)
... 52 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)
... 58 more
It seems to be related to the DTD specified on the google-checks.xml I've found on the following link on Github: https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml:
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
I've tried to add that certificate to my JVM truststore but it doesn't work.
Can anybody figure out what's going wrong?
Thank you in advance.
https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
Please use the configuration DTD for your version of Checkstyle that you are using. master is where current development is taking place. As we are changing and adding new things in master, the release versions of Checkstyle may not support it and end up with exceptions.
Here is an example Google XML for release 8.10.1: https://github.com/checkstyle/checkstyle/blob/checkstyle-8.10.1/src/main/resources/google_checks.xml

Issue with connection on Google Compute Engine

I am trying to run my Maven project in a VM Instance on Google Compute Engine using Debian 8.
What I need for this project is Cassandra, Maven, Python and Java. I have the exact same setup on my local machine as the VM Instance I'm trying to run my project on.
I have the following firewall-rules:
NAME NETWORK SRC_RANGES RULES SRC_TAGS TARGET_TAGS
allow-http default 0.0.0.0/0 tcp
allow-http-bookshelf default 0.0.0.0/0 tcp:80 http-server
default-allow-http default 0.0.0.0/0 tcp:80 http-server
default-allow-https default 0.0.0.0/0 tcp:443 https-server
default-allow-icmp default 0.0.0.0/0 icmp
default-allow-internal default 10.128.0.0/9 tcp:0-65535,udp:0-65535,icmp
default-allow-rdp default 0.0.0.0/0 tcp:3389
default-allow-ssh default 0.0.0.0/0 tcp:22
zeppelin default 0.0.0.0/0 tcp:8080 master
I don't know much about ports and networking but I'm pretty sure there's something missing here. Here's my Maven Build Failure log:
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-shade-plugin/2.4.3/maven-shade-
plugin-2.4.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-shade-plugin:2.4.3: Plugin org
.apache.maven.plugins:maven-shade-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to read
artifact descriptor for org.apache.maven.plugins:maven-shade-plugin:jar:2.4.3
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-pl
ugin-2.5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.a
pache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read arti
fact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-instal
l-plugin-2.4.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.4: Plugin org
.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved: Failed to read
artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.4
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.3/maven-reso
urces-plugin-2.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-resources-plugin:2.3: Plugin o
rg.apache.maven.plugins:maven-resources-plugin:2.3 or one of its dependencies could not be resolved: Failed to r
ead artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.3
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.10/maven-sure
fire-plugin-2.10.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-surefire-plugin:2.10: Plugin o
rg.apache.maven.plugins:maven-surefire-plugin:2.10 or one of its dependencies could not be resolved: Failed to r
ead artifact descriptor for org.apache.maven.plugins:maven-surefire-plugin:jar:2.10
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.5.1/maven-compiler-plugin-2.5.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-compiler-plugin:2.5.1: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.5.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.5.1
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-jar-plugin:2.4: Plugin org.apache.maven.plugins:maven-jar-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-jar-plugin:jar:2.4
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.0/maven-site-plugin-3.0.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-site-plugin:3.0: Plugin org.apache.maven.plugins:maven-site-plugin:3.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:3.0
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-dependency-plugin:2.1: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-release-plugin/2.0/maven-release-plugin-2.0.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.0: Plugin org.apache.maven.plugins:maven-release-plugin:2.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-release-plugin:jar:2.0
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from https://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. Original error: Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from https://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. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.817s
[INFO] Finished at: Mon Jan 23 18:37:11 UTC 2017
[INFO] Final Memory: 7M/56M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'exec' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/usr/.m2/repository), 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/NoPluginFoundForPrefixException
I would like to know what do I have to add to the firewall rules to let Maven retrieve plugin descriptors from org.apache.maven.plugins/*
All I did is package it offline with mvn package and deploy the jar file.
For the Arguments I added them to the command running the jar file
java -jar target/myJar.jar server conf.yml

Invalid packaging for parent POM , must be "pom" but is "maven-plugin"

1]
I added the maven-clean-plugin:2.6.1.jar to my local repository. I did not specify a pom, so it generated one called mavin-plugin and gives me the error messages
[WARNING] The POM for org.apache.maven.plugins:maven-clean-plugin:jar:2.6.1 is invalid, transitive dependencies (if any) will not be available: 2 problems were encountered while building the effective model for org.apache.maven.plugins:maven-clean-plugin:2.6.1
[ERROR] Invalid packaging for parent POM org.apache.maven.plugins:maven-clean-plugin:2.6.1, must be "pom" but is "maven-plugin" #
[FATAL] The parents form a cycle: org.apache.maven.plugins:maven-clean-plugin:2.6.1 -> org.apache.maven.plugins:maven-clean-plugin:2.6.1 #
2]
I also tried adding in 2.4.1 by putting in both the jar and pom.xml with its jar packaging but got the error message:
[WARNING] The POM for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1 is invalid, transitive dependencies (if any) will not be available: 2 problems were encountered while building the effective model for org.apache.maven.plugins:maven-clean-plugin:2.4.1
[ERROR] Invalid packaging for parent POM rg.apache.maven.plugins:maven-clean-plugin:2.4.1, must be "pom" but is "jar" #
[FATAL] The parents form a cycle: org.apache.maven.plugins:maven-clean-plugin:2.4.1 -> org.apache.maven.plugins:maven-clean-plugin:2.4.1 #
3]
I also tried to update the jar file but did not specify a pom.xml and got an error
Downloading: https://mvnrepository.com/artifact/org.apache.maven.plugins/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
[DEBUG] Writing resolution tracking file C:\Users\xxx\.m2\repository\org\apache\maven\plugins\maven-clean-plugin\2.4.1\maven-clean-plugin-2.4.1.pom.lastUpdated
[WARNING] The POM for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.300s
[INFO] Finished at: Tue Dec 13 13:22:06 CST 2016
[INFO] Final Memory: 6M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved:
Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1:
Could not find artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 in central (http://xxxxzero1.dev.deodiaus.com:8081/artifactory/plugins-release) -> [Help 1]
org.apache.maven.plugin.PluginResolutionException:
Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved:
Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:129)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:142)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:261)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:185)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:152)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:139)
4]
I also tried to manually change the pom.xml in my ~/repository/.../pom.xml file

Hortonworks tutorial build fails with sun.security.provider.certpath.SunCertPathBuilderException

I am trying to build "stream simulator" from "REALTIME EVENT PROCESSING IN HADOOP WITH NIFI, KAFKA AND STORM" Hortonworks tutorial in particular from its "LAB 0: INGEST, ROUTE AND LAND REAL TIME EVENTS WITH APACHE NIFI".
http://hortonworks.com/hadoop-tutorial/realtime-event-processing-nifi-kafka-storm/#stream-simulator-lab0
To give you the rough idea what is this, here is description from Hortoworks page: "The stream simulator is a lightweight framework that generates truck event data. The simulator uses New York City Truck Routes (kml) which defines driver road paths with Latitude and Longitude information.
The simulator uses Akka to simplify concurrency, messaging and inheritance. It has two Plain Old Java Objects (POJOS), one for Trucks and another for Drivers that generate the events."
When I try to build simulator as directed from latest Hortonworks Sandbox (HDP 2.4) by the end of the build Maven reports this error:
[ERROR] Failed to execute goal on project storm-kafka-0.8-plus:
Could not resolve dependencies for project net.wurstmeister.storm:
storm-kafka-0.8-plus:jar:0.4: Failed to collect dependencies at org.apache.storm:storm-core:jar:
0.9.1-incubating -> clj-time:clj-time:jar:0.4.1:
Failed to read artifact descriptor for clj-time:clj-time:jar:0.4.1:
Could not transfer artifact clj-time:clj-time:pom:0.4.1 from/to clojars (https://clojars.org/repo/):
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
More detailed (maven -e) reveals these error details:
...
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
at sun.security.validator.Validator.validate(Validator.java:260)
at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:326)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:126)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1454)
... 74 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:196)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380)
... 80 more
And here is pom.xml resulting in the build error:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.hortonworks</groupId>
<artifactId>storm-demo</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<name>Storm Demo Parent Project</name>
<modules>
<module>transport-domain</module>
<module>stream-simulator</module>
<module>storm-streaming</module>
<module>storm-demo-webapp</module>
<module>storm-kafkaplus</module>
<!-- <module>iot-integration-tester</module> -->
</modules>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Any ideas how to solve this? Please help!
Update: Next build error
After fixing certificate problem, I now have next error:
[INFO] ------------------------------------------------------------------------
[INFO] Building Storm Demo Parent Project 1.0
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-compiler-plugin/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] transport-domain ................................... SUCCESS [ 2.233 s]
[INFO] stream-simulator ................................... SUCCESS [ 3.694 s]
[INFO] storm-streaming .................................... SUCCESS [01:13 min]
[INFO] storm-demo-webapp .................................. SUCCESS [ 8.642 s]
[INFO] storm-kafka-0.8-plus ............................... SUCCESS [ 17.440 s]
[INFO] Storm Demo Parent Project .......................... FAILURE [ 0.171 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:45 min
[INFO] Finished at: 2016-07-26T14:15:46+00:00
[INFO] Final Memory: 119M/826M
[INFO] ------------------------------------------------------------------------
[ERROR] Error resolving version for plugin 'org.apache.maven.plugins:maven-compiler-plugin' from the repositories [local (/root/.m2/repository), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository
Your maven plugin is trying to connect to an https remote repository, i.e., https://clojars.org/repo/
you can use one of the solution from this post:
Problems using Maven and SSL behind proxy
My recommended solution is:
(Steps may vary between browsers)
Use a browser (using chrome) to go to https://clojars.org/repo/
Click on lock icon and choose "Details" and click "View certificate"
Go to the "Details" tab and choose "Copy to File"
Choose type "Base 64 X.509 (.CER)" and save it somewhere
Now open a command prompt and type (use your own paths):
keytool -import -file C:\temp\mavenCert.cer -keystore C:\temp\mavenKeystore
Now you can run the command again with the parameter
-Djavax.net.ssl.trustStore=C:\temp\mavenKeystore
Under linux use absolute path
-Djavax.net.ssl.trustStore=/tmp/mavenKeystore
Now you can run maven build as:
/root/maven/bin/mvn clean package -Djavax.net.ssl.trustStore=C:\temp\mavenKeystore

Could not find artifact junit:junit:jar:4.12 in central

I use Artifactory.
Intranet | Internet
---------------------------------------------------------------------
client <------> Artifactory <------|----> Remote repository: jcenter
When I run (after removing the .m2 content related to JUnit)
mvn clean package -U
on the client, I get the following error:
[ERROR] Failed to execute goal on project MyProject: Could not resolve dependencies for project com.company:MyProject:war:0.0.1-SNAPSHOT: Could not find artifact junit:junit:jar:4.12 in central (http://my-own-server:8081/artifactory/libs-release) -> [Help 1]
part of the following output:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MyProject Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://my-own-server:8081/artifactory/libs-release/junit/junit/4.12/junit-4.12.pom
Downloaded: http://my-own-server:8081/artifactory/libs-release/junit/junit/4.12/junit-4.12.pom (24 KB at 164.0 KB/sec)
Downloading: http://my-own-server:8081/artifactory/libs-release/com/oracle/ojdbc7/12.1.0.1/ojdbc7-12.1.0.1.pom
[WARNING] The POM for com.oracle:ojdbc7:jar:12.1.0.1 is missing, no dependency information available
Downloading: http://my-own-server:8081/artifactory/libs-release/junit/junit/4.12/junit-4.12.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.484s
[INFO] Finished at: Thu Feb 25 17:19:01 EET 2016
[INFO] Final Memory: 8M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project MyProject: Could not resolve dependencies for project com.company:MyProject:war:0.0.1-SNAPSHOT: Could not find artifact junit:junit:jar:4.12 in central (http://my-own-server:8081/artifactory/libs-release) -> [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
How can I fix this problem?
Details:
The connection between Artifactory and the remote repository works.
tested from Artifactory, using the Test button
the other .jar files are brought into .m2/repository (E.g.: log4j-1.2.17.jar)
The junit/junit/4.12 folder is created under .m2/repository, but it contains only the following files:
_maven.repositories
junit-4.12.jar.lastUpdated
junit-4.12.pom
junit-4.12.pom.sha1
The jcenter remote repository contains JUnit 4.12: http://jcenter.bintray.com/junit/junit/4.12/
Running
mvn clean package -U -X
will show the following output
...
Downloading: http://my-own-server:8081/artifactory/libs-release/junit/junit/4.12/junit-4.12.jar
[DEBUG] Writing resolution tracking file C:\Users\first.last\.m2\repository\junit\junit\4.12\junit-4.12.jar.lastUpdated
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.903s
[INFO] Finished at: Thu Feb 25 17:25:51 EET 2016
[INFO] Final Memory: 9M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project MyProject: Could not resolve dependencies for project com.company:MyProject:war:0.0.1-SNAPSHOT: Could not find artifact junit:junit:jar:4.12 in central (http://my-own-server:8081/artifactory/libs-release) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project MyProject: Could not resolve dependencies for project com.company:MyProject:war:0.0.1-SNAPSHOT: Could not find artifact junit:junit:jar:4.12 in central (http://my-own-server:8081/artifactory/libs-release)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:210)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:117)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:258)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:201)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.company:MyProject:war:0.0.1-SNAPSHOT: Could not find artifact junit:junit:jar:4.12 in central (http://my-own-server:8081/artifactory/libs-release)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:189)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:185)
... 22 more
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: Could not find artifact junit:junit:jar:4.12 in central (http://my-own-server:8081/artifactory/libs-release)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:375)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:183)
... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact junit:junit:jar:4.12 in central (http://my-own-server:8081/artifactory/libs-release)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:358)
... 24 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact junit:junit:jar:4.12 in central (http://my-own-server:8081/artifactory/libs-release)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:947)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:941)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:669)
at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[ERROR]
[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
If I upload manually the junit-4.12.jar file in http://my-own-server:8081/artifactory/webapp/#/artifacts/browse/tree/General/libs-release-local , it works, but I'd like to keep that folder only for the files that are not in the official remote repositories (like ojdbc7.jar).
The following URL http://my-own-server:8081/artifactory/libs-release/junit/junit/4.12/junit-4.12.jar?trace contains:
Request ID: ...
Repo Path ID: libs-release:junit/junit/4.12/junit-4.12.jar
Method Name: GET
User: admin
Time: 2016-02-25T18:02:35.664+02:00
Thread: http-nio-8081-exec-346
Steps:
2016-02-25T18:02:35.664+02:00 Received request
2016-02-25T18:02:35.664+02:00 Request source = <ip>, Last modified = 01-01-70 01:59:59 +02:00, If modified since = -1, Thread name = http-nio-8081-exec-346
2016-02-25T18:02:35.664+02:00 Executing any BeforeDownloadRequest user plugins that may exist
2016-02-25T18:02:35.664+02:00 Retrieving info
2016-02-25T18:02:35.664+02:00 Consulting the virtual repo download strategy
2016-02-25T18:02:35.664+02:00 Trying to retrieve resource info from the local storage
2016-02-25T18:02:35.664+02:00 Unable to find resource in libs-release:junit/junit/4.12/junit-4.12.jar
2016-02-25T18:02:35.664+02:00 Searching for info in aggregated repositories
2016-02-25T18:02:35.664+02:00 Preparing list of aggregated repositories to search in
2016-02-25T18:02:35.664+02:00 Appending the virtual repository 'libs-release'
2016-02-25T18:02:35.664+02:00 Appending the virtual repository 'libs-release'
2016-02-25T18:02:35.664+02:00 Appending the virtual repository 'libs-release'
2016-02-25T18:02:35.664+02:00 Appending collective local repositories
2016-02-25T18:02:35.664+02:00 Appending collective local cache repositories
2016-02-25T18:02:35.664+02:00 Appending collective remote repositories
2016-02-25T18:02:35.664+02:00 Intercepting info request with 'MavenMetadataInterceptor'
2016-02-25T18:02:35.664+02:00 Intercepting info request with 'PomInterceptor'
2016-02-25T18:02:35.664+02:00 Processing request as a release resource
2016-02-25T18:02:35.664+02:00 Searching for the resource within libs-release-local
2016-02-25T18:02:35.664+02:00 Unable to find resource in libs-release-local:junit/junit/4.12/junit-4.12.jar
2016-02-25T18:02:35.664+02:00 Searching for the resource within ext-release-local
2016-02-25T18:02:35.664+02:00 Unable to find resource in ext-release-local:junit/junit/4.12/junit-4.12.jar
2016-02-25T18:02:35.664+02:00 Searching for the resource within jcenter-cache
2016-02-25T18:02:35.664+02:00 Unable to find resource in jcenter-cache:junit/junit/4.12/junit-4.12.jar
2016-02-25T18:02:35.664+02:00 Searching for the resource within jcenter
2016-02-25T18:02:35.664+02:00 Returning an unfound resource
2016-02-25T18:02:35.664+02:00 Requested resource is found = false
2016-02-25T18:02:35.664+02:00 Request is HEAD = false
2016-02-25T18:02:35.664+02:00 Request is for a checksum = false
2016-02-25T18:02:35.664+02:00 Target repository is not remote or doesn't store locally = true
2016-02-25T18:02:35.664+02:00 Requested resource was not modified = false
2016-02-25T18:02:35.664+02:00 Responding with unfound resource
2016-02-25T18:02:35.664+02:00 Setting default response status to '404' reason to 'Resource not found'
2016-02-25T18:02:35.664+02:00 Response is an instance of UnfoundRepoResourceReason
2016-02-25T18:02:35.664+02:00 Configured to hide un-authorized resources = false
2016-02-25T18:02:35.664+02:00 Original response status is auth related = false
2016-02-25T18:02:35.664+02:00 Using original response status of '404' and message 'Could not find resource'
2016-02-25T18:02:35.664+02:00 Sending error with status 404 and message 'Could not find resource'
2016-02-25T18:02:35.664+02:00 Executing any AfterDownloadErrorAction user plugins that may exist
2016-02-25T18:02:35.664+02:00 Response code wasn't modified by the user plugins
2016-02-25T18:02:35.664+02:00 Sending response with the status '404' and the message 'Could not find resource'
My pom.xml contains:
<dependencies>
<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
...
</dependencies>
Software versions:
Artifactory Version 4.5.1
Apache Maven 3.0.5
Looks like Artifactory have a missed retrieval cached in the jcenter-cache. If Artifactory failed to get junit from JCenter for some reason (for example a timeout) it will cache this failure for the period configured in the "Missed Retrieval Cache Period" property of the remote repository.
You can clear this and force Artifactory to try and retrieve the artifact again by zapping the cache.
Applied for this situation:
Go to Artifacts > Artifact Repository Browser > jcenter-cache > junit/junit > 4.12
or just click on
http://my-own-server:8081/artifactory/webapp/#/artifacts/browse/tree/General/jcenter-cache/junit/junit/4.12
Right click on 4.12 > Zap Cache:

Resources