I'm attempting to add Oracle JDBC to my project as a maven dependency. I've followed multiple tutorials online which suggest various means to add a third party dependency.
I've opted for the local installation method, but like (this person) I'm experiencing issues.
I run the following command to install the jar:
mvn install:install-file -Dfile={lib/ojdbc7.jar} -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0.1 -Dpackaging=jar
and it succeeds with:
[INFO] --- maven-install-plugin:2.3:install-file (default-cli) # standalone-pom ---
[INFO] Installing /home/<myfolder>/{lib/ojdbc7.jar} to /home/<myname>/.m2/repository/com/oracle/ojdbc7/12.1.0.1/ojdbc7-12.1.0.1.jar
I have then added the following to my pom:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0.1</version>
</dependency>
and yet when I compile I get the following:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.307s
[INFO] Finished at: Sat May 02 20:40:07 NZST 2015
[INFO] Final Memory: 8M/56M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project xxx: Could not resolve dependencies for project com.xxx:xxx:jar:1.0-SNAPSHOT: Failure to find com.oracle:ojdbc7:jar:12.1.0.1 in 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 -> [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/DependencyResolutionException
I've played around with the -U and -o flags to no avail. I have also tried installing the jar by first cding into the lib directory (as suggested by Raghuram on the other question) with no change.
Solution
Manually place this ojdbc7-12.1.0.1.jar file in your Local Maven/Cache Repository.
Use mvn deploy goal while you are using 3rd Party Jar/Proprietary JAR Files in your Local Maven Repository.
Related
I am trying to do build and deployment from a JENKINS job for my Spring Maven Project but getting below error:
Downloading from central: https://repo.maven.apache.org/maven2/com/oracle/ojdbc6/6.0.0/ojdbc6-6.0.0.pom
[WARNING] The POM for com.oracle:ojdbc6:jar:6.0.0 is missing, no dependency information available
Downloading from central: https://repo.maven.apache.org/maven2/com/oracle/ojdbc6/6.0.0/ojdbc6-6.0.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.942 s
[INFO] Finished at: 2018-09-16T23:17:15+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project SpringBootSmaple: Could not resolve dependencies for project com.springboot.practise:SpringBootSmaple:war:0.1: Could not find artifact com.oracle:ojdbc6:jar:6.0.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]
[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/DependencyResolutionException
Build step 'Invoke top-level Maven targets' marked build as failure
Unable to deploy to IBM WebSphere Application Server, Build Result = FAILURE
Finished: FAILURE
I also installed ojdbc jar in maven by using below command:
mvn install:install-file -Dfile=C:\Documents\SharedJars\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=6.0.0 -Dpackaging=jar
But still getting the same error. Someone please guide.
I'm receiving following error when I run mvn clean install.
Error says not able to resolve dependencies javax.transaction:jta:jar:1.0.1B
Please note that I'm not refering to javax.transaction:jta:jar:1.0.1B in my pom. May be this dependency is refered by some other dependency that I mentioned in my pom.
Please find the error below
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sample-webapp Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.810 s
[INFO] Finished at: 2016-12-05T08:43:47+05:30
[INFO] Final Memory: 12M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project sample-webapp: Could not resolve dependencies for project com.ganesh:sample-webapp:war:1.0-SNAPSHOT: Could not find artifact ja
vax.transaction:jta:jar:1.0.1B in central (https://repo.maven.apache.org/maven2), try downloading from http://java.sun.com/products/jta -> [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/DependencyResolutionException
that's a legacy library that is not available from Maven Central.
It isn't available because there are still some old Sun-era Javax JARS that are not covered under open source licenses. If you need to access this JTA 1.0.1B library, you will need to replace that dependency using an exclusion.
note: and when I hit this url https://repo.maven.apache.org/maven2/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar in the browser, it return to 404 Not Found then I dont know why you can dowload it.
for more info Why can't I download the javax.transaction:jta:1.0.1B JAR?
I'm trying to run the picketlink quickstarts from:
https://github.com/jboss-developer/jboss-picketlink-quickstarts
More specifically:
https://github.com/jboss-developer/jboss-picketlink-quickstarts/tree/master/picketlink-federation-saml-idp-basic
But in each attempt to install the maven dependencies I get the next error:
Could not find artifact org.picketlink.distribution:picketlink-jbas7:jar:2.8.0.Beta1-SNAPSHOT
Here is the whole log after my $ mvn clean package jboss-as:deploy
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building PicketLink Quickstart: picketlink-federation-saml-idp-basic 2.8.0.Beta1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.picketlink.distribution:picketlink-jbas7:jar:2.8.0.Beta1-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.650 s
[INFO] Finished at: 2015-10-17T01:39:15-05:00
[INFO] Final Memory: 6M/80M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project picketlink-federation-saml-idp-basic: Could not resolve dependencies for project org.picketlink.quickstarts:picketlink-federation-saml-idp-basic:war:2.8.0.Beta1-SNAPSHOT: Could not find artifact org.picketlink.distribution:picketlink-jbas7:jar:2.8.0.Beta1-SNAPSHOT -> [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/DependencyResolutionException
I've seen that you might need to add a settings.xml to your maven folder, but I don't know how to make or what to put in that file.
As you already said, maven is telling you that org.picketlink.distribution:picketlink-jbas7:jar:2.8.0.Beta1-SNAPSHOT dependency is missing and I believe this is because you didn't install it previously.
As I can see jboss-picketlink-quickstarts is a bunch of projects which have a parent pom.xml where you can find your project as a module:
<module>picketlink-federation-saml-idp-basic</module>
So, you have to clone the whole jboss-picketlink-quickstarts project and run mvn install from the parent project.
This will lead you with all dependencies that you will need resolved into your local maven repository (usually ~/.m2/repository).
Try it, it will solve your dependency. Some times you have to call maven with -U to force -SNAPSHOT dependencies.
Hope it helps!
Any help getting me past this error would be appreciated. Google searches don't seem to turn up any helpful results.
I am on a Macbook Pro running OSX Yosemite and using the Java 1.7.0_71 with Maven 3.3. Maven was installed via HomeBrew.
To get an introduction of Google App Engine, I followed the instructions for the quickstart from https://cloud.google.com/appengine/docs/java/gettingstarted/introduction and reach the page instructions at https://cloud.google.com/appengine/docs/java/gettingstarted/ui_and_code without issue.
After creating the guestbook.jsp file and running mvn appengine:devserver I get the following build failure.
[INFO] Scanning for projects...
[WARNING] The POM for com.google.appengine:appengine-maven-plugin:jar:1.9.24 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for com.google.appengine:appengine-maven-plugin:1.9.24: Plugin com.google.appengine:appengine-maven-plugin:1.9.24 or one of its dependencies could not be resolved: Failure to find com.google.appengine:appengine-maven-plugin:jar:1.9.24 in 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
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
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 KB at 4.3 KB/sec)
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (13 KB at 2.2 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.435 s
[INFO] Finished at: 2015-07-22T21:10:29-04:00
[INFO] Final Memory: 10M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'appengine' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/nissandookeran/.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
Version 1.9.24 of the Appengine Maven Plugin hasn't been deployed to Maven Central yet, for whatever reason. Probably the easiest thing to do is to open your pom.xml, find the <version> of appengine-maven-plugin that it's using, and make it use 1.9.23 instead of ${appengine.version} or 1.9.24 or whatever it's using.
If it is due to a new version you can try also to run mvn appengine:devserver -U
You have to include the following in the pom file
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.9.48</version>
</plugin>
I need to run mvn verify in a secured box where maven is not able to download anything. I am able to run the command on my local laptop, so I copied my local .m2 folder to the secured box. However, I got this error:
$ mvn verify -o
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building <Masked strings>
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.109s
[INFO] Finished at: Wed May 07 20:49:26 UTC 2014
[INFO] Final Memory: 10M/232M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5: The repository system is offline but the artifact org.apache.maven.plugins:maven-plugins:pom:19 is not available in the local repository. -> [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/PluginResolutionException
So, looks like copying .m2 is not enough. So, what should I do to make sure maven can do the job without downloading anything?
Thank you very much.