I am trying to install a project on Ubuntu server but I am receiving the following error:
[ERROR] Failed to execute goal on project db: Could not resolve dependencies for project com.company.soft.prod:db:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: commons-codec:commons-codec:jar:1.5, mysql:mysql-connector-java:jar:5.1.26, org.springframework:spring-jdbc:jar:3.2.4.RELEASE, org.springframework:spring-beans:jar:3.2.4.RELEASE, org.springframework:spring-core:jar:3.2.4.RELEASE, org.springframework:spring-tx:jar:3.2.4.RELEASE, org.springframework:spring-orm:jar:3.2.4.RELEASE, aopalliance:aopalliance:jar:1.0, org.hibernate:hibernate-core:jar:3.5.1-Final, antlr:antlr:jar:2.7.6, commons-collections:commons-collections:jar:3.1, dom4j:dom4j:jar:1.6.1, xml-apis:xml-apis:jar:1.0.b2, javax.transaction:jta:jar:1.1, org.hibernate:hibernate-entitymanager:jar:3.5.1-Final, org.hibernate:hibernate-annotations:jar:3.5.1-Final, org.hibernate:hibernate-commons-annotations:jar:3.2.0.Final, cglib:cglib:jar:2.2, asm:asm:jar:3.1, javassist:javassist:jar:3.9.0.GA, org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final, org.springframework:spring-context:jar:3.2.4.RELEASE, org.springframework:spring-aop:jar:3.2.4.RELEASE, org.springframework:spring-expression:jar:3.2.4.RELEASE, com.existanze.libraries:orm:jar:0.0.3, joda-time:joda-time:jar:1.6.2, com.jolbox:bonecp:jar:0.7.1.RELEASE, com.google.guava:guava:jar:r08: The repository system is offline but the artifact commons-codec:commons-codec:jar:1.5 is not available in the local repository.
I have to say that locally I am not facing any problem with dependencies resolution. What I am developing is a mavenized Spring MVC multi-project in Netbeans.
Now that I am trying to deploy it to the server I receive this error. I tried also mvn clean install -U to update SNAPSHOT but it still does not work. I don't know what else to do, so at this point I need some expert help.
Thank you very much.
I suspect that your Ubuntu server does not allow external internet connection to the central repository. Please change the firewall to allow the central repository access. If this is not allowed due to your corporation security policy, you might have to deploy a enterprise maven repository within your corporation.
Related
Im trying to run maven on a linux server that does not have internet connectivity.
I installed maven but when I run "mvn compile" on my java project, it gets stuck trying to download plugins.
How do I get past it? Is there a place to get a full install with all plugins required so it dosent have to download anything?
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.apache.maven.plugins:maven-resources-plugin:jar:2.6 has not been downloaded from it before. -> [Help 1]
You can download all jars or import/move them already downloaded from another machine from userHome/.m2 to your ~/.m2 folder, and when you'll try to compile again it'll pull the libs/plugins from m2 folder without trying to download them.
No.
Running Maven does not make sense unless you are connected to a Maven repository.
If you have no internet connection then you need an internal Maven repository, i.e. a Nexus or Artifactory server in your company. Now this server does not only provide the dependencies for you, but also the plugins for Maven to run (of course, it has to get them somewhere from, so it needs some kind of connection to the internet).
I am trying to run a Spring Project, with several dependencies, that I have already downloaded into my local repository, and have also done followings :
Added local repository path in setting.xml in localRepository tag.
Running the project using mvn install -nsu -llr -o , for offline mode.
And I am getting following error :
[ERROR] Failed to execute goal on project file2Json: Could not resolve
dependencies for project
com.nse.file2Json:file2Json:jar:0.0.1-SNAPSHOT: Cannot access central
(http://repo1.maven.org/maven2) in offline mode and the artifact
com.fasterxml.jackson.dataformat:jackson-dataformat-csv:jar:2.8.4 has
not been downloaded from it before. -> [Help 1]
I have the dependency installed, take a look :(
I have following questions :
Why is the project is trying to look into http://repo1.maven.org/maven2 when I am using offline mode ?
How can I run the project offline, by providing the required dependencies at required paths ?
Please help !
thanks in advance.
It says it cannot access Maven Central because you are in offline mode. And it tries to look there, because ´jackson-dataformat-csv` is not in your local repository, so Maven needs to get it from somewhere (and Maven Central is the default repository).
What you need to do is to execute mvn dependency:go-offline before you switch to the offline mode. This will download everything that you need (dependencies, transitive dependencies as well as plugins).
I recently did a fresh install of maven. I have been trying to run mvn clean install but I keep getting a peer not authenticated error. I can acess the website with the credentials that I am using in the settings.xml file but I am unable to complete the execute my goal.
I have tried explicitly setting my path for settings.xml:
mvn clean install -s ~/.m2/settings.xml for local and global mvn clean install -gs /home/myuser/app/maven/conf/settings.xml
Double checked whether each file was using the right creds and they definitely were.
Does anyone have any other solution that I can try? Because these credentials work 100%, I just dont know why they aren't working in this case. Is there any explicit way for me to set the username and password in the command line? Because I am at my wits end with this. Been working on this for about 2 days and don't have a solution.
I was using this same maven project 6 months ago, but I don't recall ever having this problem. Talked to my co-worker and he was able to run it with the same settings that I have but hes not on a VM. Is the VM to blame? Is there some proxy setting or something that I am missing that I have to set for VMs? I am using VMWare to run my VM which is Ubuntu 16.
Thank you for all the help!
ERROR Message:
[ERROR] Failed to execute goal on project company-pojo-services: Could not resolve dependencies for project org.company:company-pojo-services:jar:3.6.1.RELEASE: The following artifacts could not be resolved: javax.jms:jms:jar:1.1, com.oracle:ojdbc6:jar:11.2.0.1.0: Could not transfer artifact javax.jms:jms:jar:1.1 from/to artifactory-online (https://reader:reader#company.artifactoryonline.com/company/company-3/repository/): peer not authenticated -> [Help 1]
EDIT:
[ERROR] Failed to execute goal on project company-pojo-services: Could not resolve dependencies for project org.company:company-pojo-services:jar:3.6.1.RELEASE: The following artifacts could not be resolved: javax.jms:jms:jar:1.1, com.oracle:ojdbc6:jar:11.2.0.1.0: Could not transfer artifact javax.jms:jms:jar:1.1 from/to artifactory-online (https://reader:reader#company.artifactoryonline.com/company/company-3/repository/): Remote host closed connection during handshake: SSL peer shut down incorrectly -> [Help 1}
This link here is exactly my problem: Maven - peer not authenticated
But too bad the solution doesnt work for me.
Reson for this is newer versions of Maven checks for SSL for https connections. Refer this to bypass the error temporarily.
[http://maven.apache.org/wagon/wagon-providers/wagon-http/][1]
For a permanent solution, you have to add the certificate to the certificate store of your JRE
On my windows machine: I have setup jenkins CI to automatically create build.
But every time build is failing because of the third party ojdbc7.jar file.
[ERROR] Failed to execute goal on project abc-cc-onboarding-repository: Could not resolve dependencies for project com.abc.cc:abc-cc-onboarding-repository:jar:1.0-SNAPSHOT: Could not find artifact com.oracle:ojdbc7:jar:12.1.0.1.0 in 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]
When I manually build using: mvn -U clean build, everything works fine.
because I have manually installed ojdbc7.jar in the local repository (.m2)
Something is wrong with the Jenkins integration with maven.
Can anybody suggest on this?
Something is wrong with the Jenkins integration with maven.
No. That's not the problem. Jenkins integration with Maven works just fine.
The problem is that ojdbc7.jar is not in the Maven Central repo ... which is the default place that Maven looks. (Or at least, it is not in Maven Central not with those artifact "coordinates". There are some ojdbc artifacts with different coordinates. YMMV.)
The real problem is that Oracle don't want you to download Oracle JARs from Maven Central. Oracle want you to download from their Maven repo instead.
One solution is to do what you have been doing. Simply add the artifact to your local repo (or Jenkins' local repo for the project). But you are not happy with that.
The other solution is to configure the remote repos that Maven uses.
Here is a page that explains how to configure (stand alone) Maven to include the Oracle repo:
Get Oracle JDBC drivers from the Oracle Maven Repository - NetBeans, Eclipse & Intellij
For the Jenkins case, you need to configure the settings that the Jenkins server uses:
How to manage maven settings.xml on a shared jenkins server?
This lists various ways of doing this.
SOLUTION THAT WORKED FOR ME:
What i found after the analysis and it resolved my problem, hope it will help somebody like me.
Actually jenkins creates a separate repository for separate projects.
like if i have 10 project in my jenkins workspace then it creates 10 repository one for each project (inside the project on top level we can see that).
so now i installed manually ojdbc7.jar inside my jenkins project repo and it solved my problem.
The above error occurs mostly when Jenkins is unable to download the oracle jar.
To sort the above issue
Create the settings.xml and settings-security.xml files in Jenkins through the "Managed files" in the administration home. To do that follow this link - https://wiki.jenkins.io/display/JENKINS/Config+File+Provider+Plugin#ConfigFileProviderPlugin-Howitworks
NB: Ensure to put in your Oracle credentials in these two files. To do that follow this link - https://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm#MAVEN9017
In your jenkins project under configurations in Build Environments include this files under the option Provide Configuration files. As shown below:
Once done build it and it should work.
I've just started helping my professor out for his research project and I'm trying to get it set up on my local windows computer. I'm stuck with this error:
Failed to execute goal on project tornado: Could not resolve
dependencies for project tornado:tornado:jar:0.0.1-SNAPSHOT: Failure
to find com.disco:disco:jar:10.2.0 in http://clojars.org/repo was
cached in the local repository, resolution will not be reattempted
until the update interval of clojars.org has elapsed or updates are
forced
Notes:
It's a maven project being run on eclipse.
I've tried multiple ways of adding the disco-2.0.jar file to the build path but I'm not sure if that's what I'm meant to be doing or if it's even the right file, although I haven't found any other disco file within the project directories.
I've tried mvn clean install -U to see if it may just have been a problem with resetting the maven project.
Well the log reads is clear and you could verify it as well:
Failure to find com.disco:disco:jar:10.2.0 in http://clojars.org/repo
If you navigate to the https://clojars.org/repo/com/ there is no disco.jar available there. Hence the failure.
Probably this could be some local jar that might need to be build either locally or required by its owner to be pushed(mvn deploy) to clojars in another case.
Also mvn clean install -U help you fetch the latest of SNAPSHOT, in your case this would fetch the latest tornado:tornado:jar:0.0.1-SNAPSHOT but that fails further sicne it specifies the com.disco:disco:jar:10.2.0 as dependency which is not found anywhere for your build to proceed.
You need to make the disco-2.0.jar available from a Maven repository. If you have a Nexus or Artifactory, upload it there. Alternatively, you can install it into the local repository of your computer using the install:install-file goal.
Furthermore, it is possible to define local directories as additional Maven repositories, see https://stackoverflow.com/a/28762617/927493.