Is UCP in Oracle Maven Repository? - oracle

Trying to build an OJDBC app via Gradle, we can find com.oracle.jdbc:ojdbc7:12.1.0.2 in the Oracle Maven Repository at https://maven.oracle.com, but we can't get com.oracle.jdbc:ucp:12.1.0.2. This 'tutorial' link from Oracle suggests it should be available: https://blogs.oracle.com/dev2dev/entry/how_to_get_oracle_jdbc
Following the instructions in the article, using Maven and a Hello, World project, Maven pulls down ojdbc7.jar but it "could not find artifact com.oracle.jdbc:ucp:jar:12.1.0.2".
Is anyone else able to get it via Maven download? Is the GAV correct?
We have retrieved the file to deposit into a local repository of "things you can't get from Maven", so we have a workaround. But it seems like this should be available, and so should need to be in such a repository.

UCP is available on Oracle Maven Repository. The GAV is
<groupId>com.oracle.jdbc</groupId>
<artifactId>ucp</artifactId>
<version>12.1.0.2</version>
I just tested downloading the UCP POM file from https://www.oracle.com/content/secure/maven/content/com/oracle/jdbc/ucp/12.1.0.2/ucp-12.1.0.2.pom and it worked fine.
Please make sure to use your Oracle usename and password correctly.

Related

Why would pom.xml fail to find Maven repository?

I need to use this repository from maven central for my application. But my application is failing to locate it. I use IntelliJ Idea and the Sync window gives me error -
Could not find artifact com.vertica:vertica-jdbc:pom:9.1.1 in central (https://repo.maven.apache.org/maven2)
This is how my pom.xml looks like -
Can anyone please let me know how can i configure my application so it can locate this vertica jdbc driver from maven central repo?
There is simply no pom nor jar for this artifact and version, in the maven central, only the sources.
This is why it can't find it.
You can download it here https://www.vertica.com/client-drivers/

Is there a way to say maven not to use timestamp for dependency resolution

I am using MAVEN3 and I have a project XXX with version 1.0.0-SNAPSHOT and it is being uploaded to artifactory.I can find the jar uploaded to artifactory as XXX-1.0.0-SNAPSHOT.jar.
Another project YYY uses XXX-1.0.0-SNAPSHOT.jar as its dependency and it is declared as
<dependency>
<groupId>...<...>
<arti...>XXX</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
When I try to build YYY maven is trying to download XXX jar file from artifactory and it fails to find.
I get the following error
Could not resolve dependencies for project com......YYY:jar:1.0.0-SNAPSHOT: Could not find artifact com....XXX:jar:1.0.0-20130710.163046-1 in repo1 (https://artifactory.xxx.com/artifactory/REPO1)
I can see that it tries to download a jar with specific timestamp.How can I tell maven not to use timestamp to download my dependency.
Any help on this is appreciated.
Support for non-unique snapshots was removed in Maven 3 (see related JIRA issue).
I found an Artifactory document mentioning one way to handle this, near the bottom of the page.
My team has noticed problems if developers publishing snapshots to the same group/artifact in the snapshot repository are not all using the same Maven version. Either everyone needs to stick with Maven 2, or everyone uses Maven 3. Mixing doesn't work well.

Maven cannot find richfaces 3.3.x in Central repo

I am trying to follow this tutorial:
http://docs.jboss.org/richfaces/latest_3_3_X/en/cdkguide/html_single/
I am hitting a roadblock with the maven commands.
First the org.richfaces.cdk version 3.3.3.Final was not found in the central repository, so I had to manually install version 4.2.2.Final to my local repository by downloading the file maven-richfaces-resources-plugin-4.2.2.Final.jar
I then had to manually install the org.richfaces.cdk plugin to my local respository.
Next, to run the command in section 4.1. I had to change archetype:create to archetype:generate. Running this command showed that maven couldn't find META-INF/archetype.xml in the jar file. I am stuck at this point. Any pointers?
Per this thread, that version of richfaces is in the JBoss Maven Repo, not Central
https://community.jboss.org/thread/172034?_sscc=t
In general, Software Vendors maintain their own Maven repos and do not push out every release to Central. SpringSource, Atlassian, and Oracle (java.net) come to mind.
Archetypes are dependencies just like project dependencies / plugins, so you will likely need to add the JBoss repository to your pom.xml or settings.xml in order for the archetype to work. See the above link for how to do that.
I figured it out! noahz's answer helped but wasn't the complete solution. I am still going to accept his answer. After substituting the Atlassion repo for the Jboss maven repo in settings.xml, I was still seeing the 'BUILD FAILURE' error saying it couldn't find the richfaces artifact. Maven was still looking in the central repo not in the Atlassian repo. So after a bit of research found that the central repo could be overriden with a tag. Follow this link:http://maven.apache.org/guides/mini/guide-mirror-settings.html.
Build is now successful.

Maven Repository

I have downloaded all artifacts in maven repository. Now I copied the repository folder content to other computer running maven. I have to access this new repository for maven commands but it is trying to connect to net for downloading artifacts required. What should I do??
Is there any way of using such repository created manually??
Are you using snapshot versions of your dependencies? If so, Maven might still try to connect to a remote repository to check if there is a new version available. However, you can avoid this by using -o (=offline), like this:
mvn -o <your_command>
Did you set the correct path to the maven repository in your settings.xml file?
This is happening because you might have a different version of Maven on your new machine and thus, it will try to install all the new compatible plugins while you try to build it. So there is no way to get around it except for using exactly the same maven version and same settings

How to deploy JAR to Maven remote repository

Is there any way to put my JAR file in remote repository, so my maven project can get this JAR file from any place via Internet?
I have downloaded and did some fixes in the ReportNG project: https://github.com/dwdyer/reportng .
Using ANT I have compiled this project into JAR, now I want to put it into remote Maven repository, but don't know how I can do that.
Could somebody please suggest me the way, how I can perform that?
If it is a released version you want to make available in maven central follow this guide: http://maven.apache.org/guides/mini/guide-central-repository-upload.html
I'm no github professional but since a maven repo is just a file structure with some meta-data you can put it anywhere maven can read it (ftp, http, ...). so you could create a git repo to host your maven artifacts. see http://cemerick.com/2010/08/24/hosting-maven-repos-on-github/ for an example. (it may be outdated - github may have something like maven repo hosting, I just dont know)
A lightweight way to create your own maven repository is to store it on github. See Hosting a Maven repository on github for more details
I followed sonatype open source project maven deployment guide https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide and successfully deployed the latest version of reportNG into maven central repository. Now maven have both 1.1.3 and 1.1.4
http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.uncommons%22%20AND%20a%3A%22reportng%22
You should do a pull request to the github project. If the maintainer likes your fix he will put it in the next version.
If you need your fix in a remote repo NOW then you'll have to setup your own maven repository.

Resources