Maven compiler-plugin access forbidden - java

Suddenly I started seeing this error when running a maven project on Jenkins
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project my-project:
Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile failed: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.8.0 or one of its dependencies could not be resolved:
Failed to collect dependencies at org.apache.maven.plugins:maven-compiler-plugin:jar:3.8.0 -> org.codehaus.groovy:groovy-eclipse-compiler:pom:3.0.0-01: Failed to read artifact descriptor for org.codehaus.groovy:groovy-eclipse-compiler:pom:3.0.0-01:
Could not transfer artifact org.codehaus.groovy:groovy-eclipse-compiler:pom:3.0.0-01 from/to bintray (https://dl.bintray.com/groovy/maven):
Authorization failed for https://dl.bintray.com/groovy/maven/org/codehaus/groovy/groovy-eclipse-compiler/3.0.0-01/groovy-eclipse-compiler-3.0.0-01.pom 403 Forbidden -> [Help 1]
Any idea what might be the issue?

org.codehaus.groovy:groovy-eclipse-compiler is available on Maven Central which is also recommended on its home page:
Current version of the groovy-eclipse-compiler adapter: maven-centralv3.7.0

Related

Error "No plugin found for prefix 'archetype' in the current project and in the plugin groups" getting in creating new java maven project

I am trying to create a new java maven project in Netbeans 8.2 . I am following the below steps:
Logs:
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: 4.914s
Finished at: Sat Feb 08 10:44:37 BDT 2020
Final Memory: 7M/119M
But I am getting this 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 (/home/sultan/.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
same issue I got, and similarly on Netbeans 8.2:
Within the Netbeans installation, this settings update worked for me:
Goto Netbeans installation folder > java > maven > conf
for me it was C:\Program Files\NetBeans 8.2\java\maven\conf, and here I updated the settings.xml file using administrative privilege.
as http repo link will not work now, just I created an valid https mirror for central repo that is pre-built with IDE which cannot be changed.
Add this inside mirrors tag of settings.xml
<mirror>
<id>mirror1</id>
<mirrorOf>central</mirrorOf>
<name>mirror1</name>
<url>https://repo.maven.apache.org/maven2/</url>
</mirror>
after this restart Netbeans IDE, and central repository will be overridden with the mirror we specified https://repo.maven.apache.org/maven2/.
The part of output says ReasonPhrase:HTTPS Required, so therefore it cannot make proper request to the http endpoint.
Try changing the URLs to the maven central repository in your maven settings.
The globals are in: ${maven.home}/conf/settings.xml
And user settings in: ${user.home}/.m2/settings.xml
There's possibility that you're using maven which comes with Netbeans installation, then you'd need to search for that setting file in netbeans installation folder. Try going to Tools/Options/Maven on netbeans interface - there should be info about the location currently used maven directory.
Search the repo.maven.apache.org/maven2 (or the whole URL from your logs) through those files and change the http to https.
Just to add, the error contains the http://repo.maven.apache.org/maven2 URL - prehaps you can search for it in that settings.xml files and change http to https.
Take a look at this two questions for more info:
Can not find where maven local repository path in netbeans 8.0.2 is set
Change Maven repository that NetBeans uses
For other info, go through short description in:
https://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
I had the same problem. My path and java_home was set to open jdk. Switching to oracle jdk fixed it.

Error Building Maven project when I do maven install

I'm trying to build a Maven Project using Spring Tool Suit from Eclipse and I'm having an error when I do the Maven Install.
First I do the Maven Clean and it works properly but when I do the maven install this error appears:
Failed to execute goal org.codehaus.mojo:build-helper-maven-plugin:1.9.1:regex-properties
(set-properties-with-regex) on project qad-webshell-pom:
Execution set-properties-with-regex of goal
org.codehaus.mojo:build-helper-maven-plugin:1.9.1:regex-properties failed:
Plugin org.codehaus.mojo:build-helper-maven-plugin:1.9.1 or
one of its dependencies could not be resolved:
Failed to collect dependencies at org.codehaus.mojo:build-helper-maven-plugin:jar:1.9.1 ->
org.beanshell:bsh:jar:2.0b4: Failed to read artifact descriptor
for org.beanshell:bsh:jar:2.0b4:
Could not transfer artifact org.beanshell:bsh:pom:2.0b4 from/to
central (http://repo1.maven.org/maven2):
Cannot access http://repo1.maven.org/maven2 with type default
using the available connector factories:
BasicRepositoryConnectorFactory:
Cannot access http://repo1.maven.org/maven2 using the registered transporter
factories: WagonTransporterFactory: java.util.NoSuchElementException
[ERROR] role: org.apache.maven.wagon.Wagon
[ERROR] roleHint: http'
I had the same issue.
I have restarted Eclipse, then go on the project specific maven module in which you have the error, right click > Maven > Update Project ...
After the Update on the specific module the Maven install worked without any error.

Maven Could not transfer artifact from/to repo1.maven.org

I am trying to build Apache Flume using mvn install -DskipTests on SLES12.
Error Message goes:
[ERROR] Failed to execute goal on project flume-ng-elasticsearch-sink: Could not resolve dependencies for project org.apache.flume.flume-ng-sinks:flume-ng-elasticsearch-sink:jar:1.7.0-SNAPSHOT: Failed to collect dependencies at org.elasticsearch:elasticsearch:jar:0.90.1: Failed to read artifact descriptor for org.elasticsearch:elasticsearch:jar:0.90.1: Could not transfer artifact org.elasticsearch:elasticsearch:pom:0.90.1 from/to repo1.maven.org (http://repo1.maven.org/maven2): init failed: /dev/[u]random closed? -> [Help 1]
I noticed that the settings.xml is missing in .m2 folder. I could think about 2 possible reasons:
lastUpdated file in .m2 prevent Maven to progress
it is behind the proxy.
How to verify which goes wrong and fix it?
Problem solved after I changed the open JDK version.

Mule 3.5.0 With Maven Is Failing

I am getting following error when trying to run mule with maven .
[ERROR] Failed to execute goal on project middleware-services: Could not resolve dependencies for project ch.koala:middleware-services:mule:1.0: Failed to collect dependencies at org.mule.transports:mule-transport-vm:jar:3.5.0 -> org.mule.modules:mule-module-xml:jar:3.5.0 -> net.java.dev.stax-utils:stax-utils:jar:20080702: Failed to read artifact descriptor for net.java.dev.stax-utils:stax-utils:jar:20080702: Could not transfer artifact net.java.dev.stax-utils:stax-utils:pom:20080702 from/to codehaus (http://repository.codehaus.org): Failed to transfer file: http://repository.codehaus.org/net/java/dev/stax-utils/stax-utils/20080702/stax-utils-20080702.pom. Return code is: 410 , ReasonPhrase:Gone. -> [Help 1]
Why is it even going to download mule-module dependencies when i have added provided tag in the pom.xml files .
what is the solution ?
Modifying the Settings.xml worked .
Here is the blog post about it

How To Create Maven Project in eclipse

I am a newbie in eclipse.I started working eclipse today onwards.
My requirement is to generate a simple maven project in eclipse.so i put my maven in my c drive and run the mvn -version.it display the version and i assume that maven is installed.
Now i am trying to execute a below command in my cmd.But it always display the error.
mvn archetype:generate -DgroupId=com.selva -DartifactId=SampleApplication -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
The error is
C:\Users\selva>mvn archetype:generate -DgroupId=com.selva
rtifactId=SampleApplication -DarchetypeArtifactId=maven-archetype-qui
tart -DinteractiveMode=false
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/pl
ns/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.p
ins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-cle
plugin:2.5 or one of its dependencies could not be resolved: Failed t
ead artifact descriptor for org.apache.maven.plugins:maven-clean-plug
jar:2.5
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/pl
ns/maven-install-plugin/2.4/maven-install-plugin-2.4.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.p
ins:maven-install-plugin:2.4: Plugin org.apache.maven.plugins:maven-i
all-plugin:2.4 or one of its dependencies could not be resolved: Fail
to read artifact descriptor for org.apache.maven.plugins:maven-instal
lugin:jar:2.4
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/pl
ns/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.p
ins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-de
y-plugin:2.7 or one of its dependencies could not be resolved: Failed
read artifact descriptor for org.apache.maven.plugins:maven-deploy-p
in:jar:2.7
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/pl
ns/maven-site-plugin/3.3/maven-site-plugin-3.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.p
ins:maven-site-plugin:3.3: Plugin org.apache.maven.plugins:maven-site
ugin:3.3 or one of its dependencies could not be resolved: Failed to
d artifact descriptor for org.apache.maven.plugins:maven-site-plugin:
:3.3
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/pl
ns/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.p
ins:maven-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-an
n-plugin:1.3 or one of its dependencies could not be resolved: Failed
read artifact descriptor for org.apache.maven.plugins:maven-antrun-p
in:jar:1.3
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/pl
ns/maven-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.p
ins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins
ven-assembly-plugin:2.2-beta-5 or one of its dependencies could not b
esolved: Failed to read artifact descriptor for org.apache.maven.plug
:maven-assembly-plugin:jar:2.2-beta-5
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/pl
ns/maven-dependency-plugin/2.8/maven-dependency-plugin-2.8.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.p
ins:maven-dependency-plugin:2.8: Plugin org.apache.maven.plugins:mave
ependency-plugin:2.8 or one of its dependencies could not be resolved
ailed to read artifact descriptor for org.apache.maven.plugins:maven-
endency-plugin:jar:2.8
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/pl
ns/maven-release-plugin/2.3.2/maven-release-plugin-2.3.2.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.p
ins:maven-release-plugin:2.3.2: Plugin org.apache.maven.plugins:maven
lease-plugin:2.3.2 or one of its dependencies could not be resolved:
led to read artifact descriptor for org.apache.maven.plugins:maven-re
se-plugin:jar:2.3.2
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/pl
ns/maven-metadata.xml
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/m
n-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-
adata.xml from/to central (https://repo.maven.apache.org/maven2): Con
t to repo.maven.apache.org:443 [repo.maven.apache.org/23.235.47.215]
led: Connection timed out: connect
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadat
ml from/to central (https://repo.maven.apache.org/maven2): Connect to
po.maven.apache.org:443 [repo.maven.apache.org/23.235.47.215] failed:
nnection timed out: connect
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata
l from https://repo.maven.apache.org/maven2 was cached in the local r
sitory, resolution will not be reattempted until the update interval
central has elapsed or updates are forced. Original error: Could not
nsfer metadata org.apache.maven.plugins/maven-metadata.xml from/to ce
al (https://repo.maven.apache.org/maven2): Connect to repo.maven.apac
org:443 [repo.maven.apache.org/23.235.47.215] failed: Connection time
ut: connect
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml fr
https://repo.maven.apache.org/maven2 was cached in the local reposito
resolution will not be reattempted until the update interval of cent
has elapsed or updates are forced. Original error: Could not transfe
etadata org.codehaus.mojo/maven-metadata.xml from/to central (https:/
po.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [re
maven.apache.org/23.235.47.215] failed: Connection timed out: connect
[INFO] --------------------------------------------------------------
-------
[INFO] BUILD FAILURE
[INFO] --------------------------------------------------------------
-------
[INFO] Total time: 04:07 min
[INFO] Finished at: 2014-09-16T16:44:58+05:30
[INFO] Final Memory: 8M/99M
[INFO] --------------------------------------------------------------
-------
[ERROR] No plugin found for prefix 'archetype' in the current project
d in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo]
ilable from the repositories [local (C:\Users\uniphore\.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
-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,
ease read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoP
inFoundForPrefixException
C:\Users\Selva>
I want to create a simple maven project in eclipse.
Any help will be greatly appreciated!
Try out with this steps.
1) In the Eclipse IDE, navigate to File > New > Other… in order to bring up the project creation wizard.
2) Scroll to the Maven folder, open it, and choose Maven Project. Then choose Next.
3) You may choose to Create a simple project or forgo this option. For the purposes of this tutorial, we will choose the simple project. This will create a basic, Maven-enabled Java project. If you require a more advanced setup, leave this setting unchecked, and you will be able to use more advanced Maven project setup features. Leave other options as is, and click Next.
4) Now, you will need to enter information regarding the Maven Project you are creating. You may visit the Maven documentation for a more in-depth look at the Maven Coordinates (http://maven.apache.org/pom.html#Maven_Coordinates). In general, the Group Id should correspond to your organization name, and the Artifact Id should correspond to the project’s name. The version is up to your discretion as is the packing and other fields. If this is a stand-alone project that does not have parent dependencies, you may leave the Parent Project section as is. Fill out the appropriate information, and click Finish.
5)You will now notice that your project has been created. You will place your Java code in /src/main/java, resources in /src/main/resources, and your testing code and resources in /src/test/java and /src/test/resources respectively.
6) Open the pom.xml file to view the structure Maven has set up. In this file, you can see the information entered in Step 4. You may also use the tabs at the bottom of the window to change to view Dependencies, the Dependency Hierarchy, the Effective POM, and the raw xml code for the pom file in the pom.xml tab.
Now your java Project with Maven using Eclipse will be created.
If you don't have Maven in Eclipse install m2e .

Categories