mvn cannot download a jar issue - maven

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.

Related

Git runner - problem to download dependency

I have one project that uses the git runner.
The command mvn package works fine on local, all dependencies are downloaded from my local nexus.
When I execute build command at the git runner environment, all dependencies from my local nexus where downloaded without problem too, but only one dependency is a problem, lets see:
[ERROR] Failed to execute goal on project sic: Could not resolve dependencies for project com.example:sic:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at br.com.sspds:ojdbc6:jar:1.0.1: Failed to read artifact descriptor for br.com.sspds:ojdbc6:jar:1.0.1: Could not transfer artifact br.com.sspds:ojdbc6:pom:1.0.1 from/to Nexus (http://172.25.100.75:8090/repository/maven-public/): Transfer failed for http://172.25.100.75:8090/repository/maven-public/br/com/sspds/ojdbc6/1.0.1/ojdbc6-1.0.1.pom: No route to host (Host unreachable)
One big detail: the library ojdbc6-1.0.1.jar was developed by our team and made available manually on our nexus server.
My configuration from nexus server is into my pom.xml.
Any idea about this problem?

Jenkins Offline cannot able to resolve Maven Dependencies

I am trying to Build a Maven Project from Jenkins.
My server is Offline, so no Internet access or no proxy settings.
Maven Project Build absolutely perfect from Jenkins if Internet is present.
But same project fails to Build from Jenkins in absence of Internet. My repo is containing this plugin.
My Maven Home:/home/oracle/app/Trust/maven
My Jenkin Home:/home/oracle/.jenkins/
.m2 file Location:/home/oracle/.m2
Error: [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: The repository system is offline but the artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 is not available in the local repository. -> [Help 1]

Can no longer build Mule projects due to closure of Codehaus

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.

Building Oozie failes

I am using maven 3.2.1,java 1.7 and Oozie4.0.0. when I tried to build it I got maven plugin and dependency error.[ERROR] Failed to execute goal on project oozie-client: Could not resolve dependencies for project org.apache.oozie:oozie-client:jar:4.0.0: Failed to collect dependencies at junit:junit:jar:4.10: Failed to read artifact descriptor for junit:junit:jar:4.10: Could not transfer artifact junit:junit:pom:4.10 from/to central (http://repo1.maven.org/maven2): repo1.maven.org: Name or service not known: Unknown host repo1.maven.org: Name or service not known -> [Help 1]
Well, it seems you can't access to repo1.maven.org. Try a another maven repo and check your internet connection ;)

Maven build error on maven install

I imported a maven project onto my eclipse. I clicked on Run As->Maven Install. But I got the following build error. Please help
plugin org.apache.maven.plugins:maven-jar-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-jar-plugin:jar 2.3.2:Could not transfer artifact org.apache.maven.plugins:maven-jar-plugin:pom: 2.3.2 from/to central(http://repo1.maven.org/maven2):Error transferring file: repo1.maven.org: Unknown host repo1.maven.org
I checked /m2/repository. But could not find anything related.
Somehow it is not able to download the required artifacts from the Maven Central repo.
A suggestion please check your network connectivity, are you behind any firewall or try to change your proxysettings.
Otherwise in the worst case try to download required artifacts manually and put them in .m2/repository (as per ur local system) and try to install again.
http://search.maven.org/#browse|672389075
It should work.
Thanks

Resources