problem creating Maven Web Project project in netbeans 8.2 - java

I went to New Project > Maven > Web Application and tried creating a maven project. I am using glassfish server 4.1.1 and java EE 7 Web. when i click on finish I get this error.
cd D:\NetbeansProjects; "JAVA_HOME=C:\Program
Files\Java\jdk1.8.0_121\jre" cmd /c """C:\Program
Files\NetBeans 8.2\java\maven\bin\mvn.bat"
-DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=webapp-javaee7 -DarchetypeVersion=1.1 -DarchetypeRepository=http://repo.maven.apache.org/maven2 -DgroupId=com.org.nepmart -DartifactId=mavenproject2 -Dversion=1.0-SNAPSHOT -Dpackage=com.org.nepmart.mavenproject2 -Dbasedir=D:\NetbeansProjects -Darchetype.interactive=false -Dmaven.ext.class.path="C:\Program Files\NetBeans 8.2\java\maven-nblib\netbeans-eventspy.jar" --batch-mode archetype:generate"" Scanning for projects... Downloading:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
Failed to retrieve plugin descriptor for
org.apache.maven.plugins:maven-clean-plugin:2.4.1: 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 Downloading:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.pom
Failed to retrieve plugin descriptor for
org.apache.maven.plugins:maven-install-plugin:2.3.1: Plugin
org.apache.maven.plugins:maven-install-plugin:2.3.1 or one of its
dependencies could not be resolved: Failed to read artifact descriptor
for org.apache.maven.plugins:maven-install-plugin:jar:2.3.1
Downloading:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
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:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.0/maven-site-plugin-3.0.pom
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:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom
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:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom
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:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom
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:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-release-plugin/2.0/maven-release-plugin-2.0.pom
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:
http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Could not transfer metadata
org.apache.maven.plugins/maven-metadata.xml from/to central
(http://repo.maven.apache.org/maven2): Failed to transfer file:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml.
Return code is: 501 , ReasonPhrase:HTTPS Required. Could not transfer
metadata org.codehaus.mojo/maven-metadata.xml from/to central
(http://repo.maven.apache.org/maven2): Failed to transfer file:
http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml.
Return code is: 501 , ReasonPhrase:HTTPS Required. Failure to transfer
org.apache.maven.plugins/maven-metadata.xml from
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. Original error:
Could not transfer metadata
org.apache.maven.plugins/maven-metadata.xml from/to central
(http://repo.maven.apache.org/maven2): Failed to transfer file:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml.
Return code is: 501 , ReasonPhrase:HTTPS Required. Failure to transfer
org.codehaus.mojo/maven-metadata.xml from
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. Original error:
Could not transfer metadata org.codehaus.mojo/maven-metadata.xml
from/to central (http://repo.maven.apache.org/maven2): Failed to
transfer file:
http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml.
Return code is: 501 , ReasonPhrase:HTTPS Required.
------------------------------------------------------------------------ BUILD FAILURE
------------------------------------------------------------------------ Total time: 7.510s Finished at: Thu Sep 10 16:15:21 NPT 2020 Final
Memory: 6M/62M
------------------------------------------------------------------------ No plugin found for prefix 'archetype' in the current project and in
the plugin groups [org.apache.maven.plugins, org.codehaus.mojo]
available from the repositories [local (C:\Users\Aashish
Katwal.m2\repository), central (http://repo.maven.apache.org/maven2)]
-> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e
switch. Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please
read the following articles: [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
Some body please help!!!

I suspect it's https issue, you could try adding this to pom.xml:
(after <packaging>...</packaging> tags)
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

Related

Maven: Failed to retrieve plugin descriptor and peer not authenticated errors despite the settings.xml having repositories configured with HTTPS

I have Maven 3.0.5 with Java 8 setup (that's for particular project and stack versions won't be revised).
I'm aware of Apache's new decision to force all the Maven repositories to only use HTTPS, otherwise Maven clients won't be able to speak to the repository servers.
It seems like I have configured all necessary settings in ~/.m2/settings.xml but for some reason, when I any build phase (say mvn clean), Maven defaults to HTTP and doesn't care about settings.xml - it still attempts to download references/dependencies with HTTP protocol.
Example of my settings.xml
(For simplicity, I removed project specific things and left only problem-related stuff):
<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
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2/</url>
</repository>
</repositories>
and here is what I'm getting when I do mvn archetype:generate, just to test the behaviour of Maven (the problem is persistent for any other command that tries to reach servers out):
[INFO] Scanning for projects...
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.3/maven-install-plugin-2.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.3: Plugin org.apache.maven.plugins:maven-install-plugin:2.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.3
Downloading: http://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: http://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: http://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: http://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: http://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: http://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: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml. Return code is: 501 , ReasonPhrase:HTTPS Required.
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml. Return code is: 501 , ReasonPhrase:HTTPS Required.
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from 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.
Original error: Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml. Return code is: 501 , ReasonPhrase:HTTPS Required.
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from 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.
Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml. Return code is: 501 , ReasonPhrase:HTTPS Required.
What shall I do? as you see, it still uses HTTP, and I, correspondingly, get HTTP 501.
In your case, it seems to be working for dependencies, but not for plugins. You need to define a <profile> that is activeByDefault and contains a <pluginRepositories/> section for both snapshot and releases.
Maven has two types of repositories:
For dependencies
For plugins
The <mirrorOf> section only handles dependency repositories.
There were two problems:
Problem 1:
[WARNING] Failed to retrieve plugin descriptor for .. (whatever plugin name) warnings during almost any build phase, which says that (important>) the retrieval of plugin descriptors or its dependencies (which means plugins, and not the project dependencies!) is not going successful.
Here, Maven attempts to communicate with the end-point machine (repository) via HTTP, despite the fact(!), that I have customized my configuration .m2\settings.xml file and all the repository definition entries are with HTTPS, respectively, seems like Maven should be trying everything via HTTPS ..but no, it uses HTTP for plugins, and any HTTP communication with Maven repositories is forbidden since the 15th of January, 2020.
The way I resolved this is to define and configure <profiles/> and <pluginRepositories/> as #carlspring suggested, but I had to elaborate and expand that answer a bit.
So, here is my ready working settings.xml example: (note, that just to be safe, I provided alternative repositories in both - profiles and repositories)
<settings
xmlns="http://maven.apache.org/SETTINGS/1.0.0" $ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>ssl-profile</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>central-1</id>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central-2</id>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<repositories>
<repository>
<id>central1</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>central2</id>
<url>https://repo.maven.apache.org/maven2/</url>
</repository>
</repositories>
</profiles>
</settings>
After this was resolved, and finally Maven attempted to connect to all the repositories via HTTPS, I then had another,
Problem 2:
peer not authenticated followed by Return code is: 501 , ReasonPhrase:HTTPS Required.
This was a bit tricky, but the way of solving this is to play with truststore cacerts file.
First, check whether you have truststore file cacerts and whether it's empty. it must NOT be empty and this is very important.
It seems like, in the OpenJDK 11 and in some other builds for Windows/Linux systems, cacerts file is either missing or present, but empty; however, according to my observation, it was present in Oracle JDK builds.
On Windows builds, it should be under %JAVA_HOME%\lib\security\;
On Linux builds, it may vary (depending on Linux distribution and your setup), but in my case, it was under /etc/ssl/certs (and I think that's Linux's certificates folder, not particularly Java's one).
If you see, that cacerts file is either absent or empty (simply check the file size, it should be larger than few bits), you can either:
Simply copy-paste existing cacerts file from some other JDK/JRE build;
Generate a cacerts truststore file and add certificate(s) to it. In this case, you will need to add as many certificates as you need, so, maybe it's easier to go with just a copy-paste variant.
I hope this helps.
I would suggest to go the following path:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<mirrors>
<mirror>
<id>central</id>
<name>central</name>
<url>https://repo1.maven.org/maven2/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
</settings>
This will redirect all request via the above URL. If you have a repository manager inside of your corporate environment it's better to use this one and let the repo manager handle the https stuff.
Also an upgrade of Maven to most recent version 3.6.3 and I supose you are not using the most recent versions of plugins which I strongly recommend to upgrade there had been a lot of improvements.

MVN project is not being created

I am trying to create a web service using Maven using Netbeans 8.2 however, Nothing is created and am getting the following output.
cd D:\Applications\mavenproject1; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_121\\jre" "M2_HOME=C:\\Program Files (x86)\\apache-maven-3.3.9" cmd /c "\"\"C:\\Program Files (x86)\\apache-maven-3.3.9\\bin\\mvn.cmd\" -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=ejb-javaee7 -DarchetypeVersion=1.1 -DarchetypeRepository=http://repo.maven.apache.org/maven2 -DgroupId=com.iirosa -DartifactId=mavenproject1-ejb -Dversion=1.0-SNAPSHOT -Dbasedir=D:\\Applications\\mavenproject1 -Darchetype.interactive=false -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans 8.2\\java\\maven-nblib\\netbeans-eventspy.jar\" --batch-mode archetype:generate\""
Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact 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-install-plugin-2.4.pom
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-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
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.3/maven-site-plugin-3.3.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-site-plugin:3.3: Plugin org.apache.maven.plugins:maven-site-plugin:3.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:3.3
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom
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
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.8/maven-dependency-plugin-2.8.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-dependency-plugin:2.8: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.8 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.8
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-release-plugin/2.3.2/maven-release-plugin-2.3.2.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.3.2: Plugin org.apache.maven.plugins:maven-release-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-release-plugin:jar:2.3.2
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
Could not transfer metadata org.apache.maven.plugins/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
Could not transfer metadata org.codehaus.mojo/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
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): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
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): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 2.418 s
Finished at: 2017-01-31T14:58:29+03:00
Final Memory: 12M/309M
------------------------------------------------------------------------
No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\Feras.Felimban\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
Windows7 64 bit -- Netbeans 8.2 -- JDK8 update 121 -- apache-maven-3.3.9 -- glassfish 4.1.1
I have looked on the previous questions related to mine and have tried all suggested solutions but nothing worked. Environment Var are all set:
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
M2_HOME=C:\Program Files (x86)\apache-maven-3.3.9
MAVEN_HOME=C:\Program Files (x86)\apache-maven-3.3.9
MAVEN_OPTS=-Xms256m -Xmx512m
PATH=....;%M2_HOME%\bin;%M2%
Please note that the project is not being created at all, so its NOT the case that i am not being able to open a project.
I have visited the site that the output is showing but I had no luck (:
Your help is appreciated.
This looks like you may be behind a corporate proxy.
You need to follow the instructions at Maven - Guide to using proxies.
Additionally, I recommend removing the M2_HOME and MAVEN_HOME environment variables. See MAVEN_HOME, MVN_HOME or M2_HOME. Just set the %PATH% directly.
The fact is that your maven plugin try to connect to an https remote repository https://repo.maven.apache.org/maven2 and it failed with invalid security certification. Add following in your pom.xml
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Maven Plugin Repository</name>
<url>http://repo1.maven.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
</pluginRepositories>
The cause: I was behind the company's firewall, which have resulted in not allowing Netbeans downloading the required plugins.
My simple solution was to connect to a different network and run the project and it automatically started downloading the required plugins. I did not have to change any files or configurations at all.

Running Maven Project in Google Compute Engine [Debian 8] Build fails

I am trying to run my maven Java application on a VM Instance on Google Compute Engine.
Here's what I have already added in my machine:
Python 2.7
Java 1.8
Cassandra
CQL
Maven
I'm trying to run my application on this VM but it seems like it is having issues retrieving plugin descriptors for most of the dependencies I have added to my pom.xml, which gives the Build Failure bellow.
[INFO] Scanning for projects...
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
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (https://repo.maven.a
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-surefire-plugin-2.10.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-surefire-plugin:2.10: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.10 or one of its dependencies could not be resolved: Failed to read 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 my_user#vm-test-2:~/default$ mvn compile exec:java -Dexec.mainClass="main.AccessApplication" -Dexec.args="server conf.yml"
[INFO] Scanning for projects...
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-plugin-2.5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact 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-install-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-resources-plugin-2.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-resources-plugin:2.3: Plugin org.apache.maven.plugins:maven-resources-plugin:2.3 or one of its dependencies could not be resolved: Failed to read 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-surefire-plugin-2.10.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-surefire-plugin:2.10: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.10 or one of its dependencies could not be resolved: Failed to read 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.436s
[INFO] Finished at: Thu Jan 19 21:51:16 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/my_user/.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
Since it had issues retrieving plugins, it is giving me the error
[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/my_user/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
And when we go to the error link, it confirms there's issues with the plugins, but I'm certain I'm just missing something in my VM since the exact same code works perfectly on my local Ubuntu operating system, which is probably irrelevant since my coworkers also makes the build succeed in their respective Mac OS and Windows machines.
Only solution I found is build the Maven project locally and deploy the jar file.

Maven Error While Creating java Project using Command Line

I got error while creating new java project using maven. I have set all of the envrionmnet variable and now going to create a project using maven cammand. when i use this command i got build failure error.
mvn archetype:generate -DgroupId=com.tutorial.test -DartifactId=hellowrld
-DarchetypeArtifactId=maven-archetype-webapp
Please help me. Is i missing something?
This is the whole output
[INFO] Scanning for projects...
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.4.1:
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
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.3.1:
Plugin org.apache.maven.plugins:maven-install-plugin:2.3.1 or one of its dependencies could not be resolved:
Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.3.1
Downloading: http://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: http://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: http://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: http://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: http://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: http://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: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://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 (http://repo.maven.apache.org/maven2): repo.maven.apache.org
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from 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.
Original error: Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from 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.
Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org
[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------ [INFO] Total time: 12.696s
[INFO] Finished at: Tue May 21 05:33:14 ACT 2013 [INFO] Final Memory: 2M/127M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\waqas.ali\.m2\repository), central (http://repo.maven.apache.org/maven2)] -> [Help 1]
I think you are behind a proxy, try using the below command
mvn -DproxySet=true -DproxyHost=myproxy.com -DproxyPort=3128 archetype:generate
Hope it helps.
This command i used for creating Spring project for WS and successfully created also .
mvn archetype:create -DarchetypeGroupId=org.springframework.ws -DarchetypeArtifactId=spring-ws-archetype -DarchetypeVesrion=1.0.0 -DgroupId=com.mytutorial -DartifactId=simpleWeb2
Hope this will help.

Maven is not using repo1, it's going over to maven.glassfish.org and failing my build

I have this repo section:
<repositories>
<repository>
<id>Repo1</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
</repository>
<repository>
<id>EclipseLink</id>
<url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
</repository>
</repositories>
and this dependency:
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.9.1</version>
<scope>compile</scope>
</dependency>
Why is maven continuously going to download.java.net and maven.glassfish.org ? It's not in my poms anywhere
Downloading: http://download.java.net/maven/glassfish//com/ocpsoft/prettyfaces-parent/3.3.3/prettyfaces-parent-3.3.3.pom
[INFO] Unable to find resource 'com.ocpsoft:prettyfaces-parent:pom:3.3.3' in repository Glassfish (http://download.java.net/maven/glassfish/)
Downloading: http://repo1.maven.org/maven2/com/ocpsoft/prettyfaces-parent/3.3.3/prettyfaces-parent-3.3.3.pom
8K downloaded (prettyfaces-parent-3.3.3.pom)
Downloading: http://download.java.net/maven/glassfish//com/ocpsoft/ocpsoft-parent/2/ocpsoft-parent-2.pom
[INFO] Unable to find resource 'com.ocpsoft:ocpsoft-parent:pom:2' in repository Glassfish (http://download.java.net/maven/glassfish/)
Downloading: http://repo1.maven.org/maven2/com/ocpsoft/ocpsoft-parent/2/ocpsoft-parent-2.pom
1K downloaded (ocpsoft-parent-2.pom)
Downloading: http://repo1.maven.org/maven2/com/sun/jersey/jersey-client/1.9.1/jersey-client-1.9.1.pom
6K downloaded (jersey-client-1.9.1.pom)
Downloading: http://repo1.maven.org/maven2/com/sun/jersey/jersey-project/1.9.1/jersey-project-1.9.1.pom
17K downloaded (jersey-project-1.9.1.pom)
Downloading: http://download.java.net/maven/2/net/java/jvnet-parent/1/jvnet-parent-1.pom
[INFO] Unable to find resource 'net.java:jvnet-parent:pom:1' in repository m2.java.net (http://download.java.net/maven/2)
Downloading: http://repository.jboss.org/nexus/content/groups/public//net/java/jvnet-parent/1/jvnet-parent-1.pom
[INFO] Unable to find resource 'net.java:jvnet-parent:pom:1' in repository repository.jboss.org (http://repository.jboss.org/nexus/content/groups/public/)
Downloading: http://maven.glassfish.org/content/groups/glassfish/net/java/jvnet-parent/1/jvnet-parent-1.pom
185b downloaded (jvnet-parent-1.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '6c9fd3d150b8a5f0ca676f49b8ed603793cabebb'; remote = '<html>
<head><title>301' - RETRYING
Downloading: http://maven.glassfish.org/content/groups/glassfish/net/java/jvnet-parent/1/jvnet-parent-1.pom
185b downloaded (jvnet-parent-1.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '6c9fd3d150b8a5f0ca676f49b8ed603793cabebb'; remote = '<html>
<head><title>301' - IGNORING
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: com.sun.jersey:jersey-project:pom:1.9.1
Reason: Cannot find parent: net.java:jvnet-parent for project: com.sun.jersey:jersey-project:pom:1.9.1 for project com.sun.jersey:jersey-project:pom:1.9.1
EDIT:
As a debug step, I've nuked ~/.m2... I don't know what is going on, but this build used to work.
MOR EDIT:
Ok, so I should have mentioned, the repositories section is in the parent pom and the dependency is in the child pom. If I put the configuration into one big pom it works. Two poms, it fails. What the heck??
EVEN MOR EDIT:
This is absolutely crazy where maven is getting the extra repositories at, I even checked the artifact poms. Anyway, here is my solution to the unexplained behavior. Put this in my settings.xml:
<settings>
<mirrors>
<mirror>
<id>central-mirror</id>
<url>http://repo.maven.apache.org/maven2</url>
<mirrorOf>*,!eclipselink</mirrorOf>
</mirror>
</mirrors>
</settings>
This forces maven to use central, except for when I'm using the eclipselink repo. Sigh, argh!
This is absolutely crazy where maven is getting the extra repositories at, I even checked the artifact poms. Anyway, here is my solution to the unexplained behavior. Put this in my settings.xml:
<settings>
<mirrors>
<mirror>
<id>central-mirror</id>
<url>http://repo.maven.apache.org/maven2</url>
<mirrorOf>*,!eclipselink</mirrorOf>
</mirror>
</mirrors>
</settings>
This forces maven to use central, except for when I'm using the eclipselink repo. This doesn't answer my question, but it's a workaround for whatever crazy reason maven is contacting these external repos.
Repositories can also be specified in your settings.xml and other dependencies' poms. Regardless of which repositories you do directly or indirectly name, maven doesn't guaranty the search order for those repositories, If maven happems to find a bad artifact in one repository, it fails (obviously) and doesn't try any other repositories.
If you can find a good version of the artifact that's giving you trouble, you might try manually placing that artifact in your local .m2 repository.

Categories

Resources