Can no longer build Mule projects due to closure of Codehaus - maven

After the closure of codehaus, I can no longer build any Mule project that uses the mule-scripting-component because it is trying to download an artifact from codehaus(which it can no longer due to the closure of aforementioned site). When I try to build I get the following error:
Could not resolve dependencies for project my.company.muleproject:mule-subproject-page:mule-module:1.0.1: Failed to collect dependencies at org.mule.modules:mule-module-scripting:jar:3.6.0 -> javax.script:jruby-engine:jar:jdk14:1.1: Failed to read artifact descriptor for javax.script:jruby-engine:jar:jdk14:1.1: Could not transfer artifact javax.script:jruby-engine:pom:1.1 from/to codehaus-mule-repo (http://repository.codehaus.org): peer not authenticated -> [Help 1]
What can I do in order to get Mule to ignore the codehaus repo?

As already mentioned, setting up a Mirror in your Maven settings.xml will fix it. Just to be a bit more explicit, this is what I added to workaround the issue:
<mirror>
<id>mule-codehaus-mirror</id>
<mirrorOf>codehaus-mule-repo,codehaus-releases,codehaus-snapshots</mirrorOf>
<name>Mule Codehaus Mirror</name>
<url>https://repository.mulesoft.org/nexus/content/repositories/public</url>
</mirror>

Mulesoft has mirrored and copied the codehaus repository in the following repo:
https://repository.mulesoft.org/nexus/content/repositories/public/

Although it's in maven central the poms for all the mule libraries still point to codehaus which is causing the error. I unfortunately had to resort to using mirrors to fix this. Since all the artifacts are in either maven central or the mule repos, I just added mirrors in my maven's settings.xml to point any and all codehaus repos to maven central. This is less than ideal but fixed the issue.

Related

Intellij 2021.3: Maven not able to resolve dependencies after update to intellij 2021.3

Things worked fine in 2021.2 but when same project opened in 2021.3 then stated to got following error
http://0.0.0.0/ during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of maven-default-http-blocker has elapsed or updates are forced. Original error: Could not transfer metadata com.domain.sub-domain.project:private-commons:1.0.0-SNAPSHOT/maven-metadata.xml from/to maven-default-http-blocker (http://0.0.0.0/): transfer failed for http://0.0.0.0/com/domain/sub-domain/project/private-repo/1.0.0-SNAPSHOT/maven-metadata.xml
Cannot resolve junit:junit:4.12
Cannot resolve org.apache.camel:camel-test:2.23.0
Cannot resolve com.amazonaws:aws-java-sdk-glacier:1.11.415
2021.3 IDE version has updated the version of the bundled Maven to 3.8.1. In this version, Maven blocks the access to http repositories by default. Before that, Maven itself has moved from using the http repositories.
So now one needs to explicitly configure Maven to allow http repositories if they are used in the project. E.g. in settings.xml add a mirror to your http repository that allows HTTP:
<mirrors>
<mirror>
<id>my-repo-mirror</id>
<name>My Repo HTTP Mirror</name>
<url>http://url-to.my/repo</url>
<mirrorOf>my-repo</mirrorOf>
</mirror>
</mirrors>
You can also check the related discussion at https://stackoverflow.com/a/67002852/2000323 for ways to configure it.
Another option is to specify older Maven version in IDE: Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Maven | Maven home path.

How to resolve codehaus "service unavailable" maven build error?

As codehaus repository is no longer available, I get the following error whenever I try to do "Run As - Maven install" in Eclipse. Below is the error that I get:
[WARNING] Could not transfer metadata
org.eclipse.core:commands/maven-metadata.xml from/to Codehaus Internal
(http://repository.codehaus.org): Failed to transfer
http://repository.codehaus.org/org/eclipse/core/commands/maven-metadata.xml.
Error code 503, Service Temporarily Unavailable Downloading:
http://repository.codehaus.org/org/eclipse/equinox/common/maven-metadata.xml
I also see that maven dependency problem has started coming up for one of the jar files that is not there in Demosite -> pom.xml. Below is the complete error information:
ArtifactDescriptorException: Failed to read artifact descriptor for
org.restlet.jee:org.restlet:jar:2.1.1: ArtifactResolutionException:
Failure to transfer org.restlet.jee:org.restlet:pom:2.1.1 from
http://repository.codehaus.org was cached in the local repository,
resolution will not be reattempted until the update interval of
Codehaus Internal has elapsed or updates are forced. Original error:
Could not transfer artifact org.restlet.jee:org.restlet:pom:2.1.1
from/to Codehaus Internal (http://repository.codehaus.org): Failed to
transfer
http://repository.codehaus.org/org/restlet/jee/org.restlet/2.1.1/org.restlet-2.1.1.pom.
Error code 503, Service Temporarily Unavailable
How to resolve these 2 blockers?
Since Codehaus.org artifacts have all been transfered to Central, one easy way to keep using legacy pom.xml files is to declare the mirror as such in your settings.xml, e.g. :
<mirror>
<id>RIP Codehaus</id>
<mirrorOf>codehaus.org</mirrorOf>
<name>Codehaus.org repo is now in Central. R.I.P.</name>
<url>http://repo.maven.apache.org/maven2</url>
</mirror>
From the Codehaus services 503 message:
All Codehaus services will be terminated progressively until May 17th 2015
If you have been directed here, then the service you are accessing may have been disabled already, or we are trying to get your attention by blacking out services early.
See more detailed information here: https://www.codehaus.org/
If you have these repositories configured in any pom.xml or settings.xml you need to change these to another or just remove these, if these dependencies are in the default repository.
For example, for restlet you may use this repository: http://maven.restlet.com/
If this repository is in a pom.xml from a dependecy, just let pass this message, the download will be tried in another repository.
We have removed this repository from the Broadleaf pom.xml, thanks for pointing it out. This was originally added because MVEL did not have a Java 8-compatible jar uploaded to Maven Central.
See https://github.com/BroadleafCommerce/BroadleafCommerce/issues/1367 for reference.
the codehaus repository is mirrored Mulesoft in the following repo:
https://repository.mulesoft.org/nexus/content/repositories/public/

mvn cannot download a jar issue

when I build a project in linux environment, it says:
[ERROR] Plugin org.apache.maven.plugins:maven-enforcer-plugin:1.0-beta-1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-enforcer-plugin:jar:1.0-beta-1: Could not transfer artifact org.apache.maven.plugins:maven-enforcer-plugin:pom:1.0-beta-1 from/to Main Maven Repo (http://repo1.maven.org/maven2/): repo1.maven.org: Unknown host repo1.maven.org -> [Help 1]
I'm using my company internal mirror repository.
Any one help me?
Update:
I copied the .m2 folder to the linux home/user_name , resolved this issue
If you want to use only your company's repo and not the public ones, such as maven central, take a look here Disable Maven central repository.
Otherwise you need your station/network configured to allow access to the public repos and resolve their IPs from the hostnames.

Failed to resolve artifact (snapshot) from my artifactory repository

I've got a local artifactory repository. I've got a dependency in one of my app's pom.xml like the following:
<dependency>
<groupId>org.activequant</groupId>
<artifactId>activequant-p2</artifactId>
<version>1.3-SNAPSHOT</version>
</dependency>
I deployed an activequant-p2-1.3-SNAPSHOT.jar to my 'ext-local-snapshot' repository. Artifactory deployed it under org/activequant/activequant-p2/activequant-p2-1.3-20130925.170928.jar . Now when i run 'mvn package':
Downloading: http://artifactory.myrepos.local/libs-snapshot/org/activequant/activequant-p2/1.3-SNAPSHOT/activequant-p2-1.3-SNAPSHOT.pom
[INFO] Unable to find resource 'org.activequant:activequant-p2:pom:1.3-SNAPSHOT' in repository snapshots (http://artifactory.myrepos.local/libs-snapshot)
And fails, because http://artifactory.myrepos.local/libs-snapshot/org/activequant/activequant-p2/1.3-SNAPSHOT/activequant-p2-1.3-SNAPSHOT.pom does not exist (It's under http://artifactory.myrepos.local/libs-snapshot/org/activequant/activequant-p2/1.3-SNAPSHOT/activequant-p2-1.3-20130925.170928.pom).
How should i deploy the artifact in my artifactory or configure my pom.xml to fix this problem?
Looked at this: Maven: Why is the -SNAPSHOT suffix missing from artifact file name? , which seems like the problem, but i'm using maven3 on the client side, so there's no 'uniqueVersion' tag at all. I tried changing the "Maven Snapshot Version Behavior" setting for my repository, but that does not fix the problem.
For some reason my local maven repository was dirty (no snapshot timestamps in metadata file downloaded). Running maven did no substitute the metadata, so i deleted my org/activequant/activequant-p2 manually from my local repos and all went ok.

maven could not resolve dependency via my local nexus repository

I have setup an in-house Sonatype Nexus repository and configure the maven to check my local Nexus instead of getting artifacts directly from public repositories.
http://www.sonatype.com/books/nexus-book/reference/config-sect-intro.html
Our project was able to download the most artifacts except one artifact in Maven central.
Here is the build error:
Failed to execute goal on project shindig-gadgets: Could not resolve dependencies for project org.apache.shindig:shindig-gadgets:jar:3.0.0-SNAPSHOT: Could not find artifact com.ibm.icu:icu4j:jar:4.6 in nexus (http://my_nexus_repository:8081/nexus/content/groups/public) -> [Help 1]
I see that icu4j-4.6.jar does exist in the Maven central repository. On my local nexus repository, it doesn't exist. I see only icu4j-4.6.pom exists on my local nexus repository.
It's not like my nexus repository setting is totally broken. maven project has successfully downloaded numerous jar files from multiple public repositories via my local nexus maven repository except icu4j-4.6.jar.
I don't understand why I'm having a problem with only icu4j-4.6.jar. Would it be incorrectly cached on either my local maven or nexus maven repository?
If it was incorrectly cached, how can I clean the local maven or nexus maven repository?
The similar problem is described at
Missing maven dependency using nexus setup
icu4j-4.6.jar does not show up in the search list. Only icu4j-4.6.pom shows up in the search list. I don't think is Snapshot VS Release issue because icu4j-4.6.jar seems release jar.
Is it possible that the nexus repo just stopped responding for a while? You can try mvn -X (or -d?) to get detailed info about what is going on. You might also try configuring an alternative repo.
Perhaps you haven't enabled remote index downloads from Maven Central. This would explain why only the POM file appears in your local search (The only file which has been downloaded via the proxy repo).
There might be another issue causing the download failure for the jar itself.... I suppose try and solve one problem at a time :-)
Try adding -U to your mvn arguments to force an update of your local repository.
You could also have corrupt meta data in the repo. In which case, delete that artifact from the repo's cache and let it refresh.
If the artifact in question was cached in properly from the proxy repository, using mvn -U will fix the problem
However if you are seeing pom on your nexus ,this usually happens when the artifact from the proxy repository is not cached in properly. The way to fix is
1) Browse to the component in the Proxy Repository.
2) Invalidate the cache for the repository and reindex the Nexus repository.
3) run mvn clean -U

Resources