Why mvn install Oracle JDBC ojdbc6 Jar always has 'No plugin found for prefix' error, and fail mvn build? - oracle

I follow the below two links to download ojdbc jar and install it locally in Windows system:
Oracle JDBC ojdbc6 Jar as a Maven Dependency
Maven install:install-file : specified file not exists
https://www.mail-archive.com/users#maven.apache.org/msg83991.html
I end up using below command (use ` to escape -):
mvn install:install-file `-Dfile=C:\Users\xxx\ojdbc6.jar `-DgroupId=com.oracle `-DartifactId=ojdbc6 `-Dversion=11.2.0.2.0 `-Dpackaging=jar `-DgeneratePom=true
but I am still getting below errors:
[ERROR] No plugin found for prefix '`-Dfile=C' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\peter\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
Also, although it looks like by doing above, ojdbc jar is installed under .m2/repository, when I run mvn install to the project, I am still getting:
Failure to find com.oracle:ojdbc6:jar:11.2.0.2.0 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 -> [Help 1]
How can I resolve this?

Why are you putting backquotes (`) in your command? Try to run it without backquotes.
mvn install:install-file -Dfile=C:\Users\xxx\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.2.0 -Dpackaging=jar -DgeneratePom=true

Related

Where to manually download the JARS from when Maven cannot find a dependency

I want to create a Maven webapp sample project on a dev machine without internet, but with access a Nexus repo via the local network. The Nexus repo is years old, so it has most dependencies, but not all.
I have set up maven that it uses the local Nexus and then I typed:
$ mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.4
Maven goes off and downloads what it can from the local Nexus, but then it fails with:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate (default-cli) on project standalone-pom: Execution default-cli of goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate failed: Plugin org.apache.maven.plugins:maven-archetype-plugin:2.4 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.codehaus.plexus:plexus-component-api:jar:1.0-alpha-16, org.codehaus.plexus:plexus-classworlds:jar:1.2-alpha-7: Failure to find org.codehaus.plexus:plexus-component-api:jar:1.0-alpha-16
Due to the fact that the machine is not connected to the internet and that I have no control over the Nexus repo (so cannot add jars to it), would need to download the depend JARs for org.codehaus.plexus:plexus-component-api and org.codehaus.plexus:plexus-classworlds manually (on another internet-connected computer).
Where on the Internet do I find them? -- I tried a search on https://jar-download.com/online-maven-download-tool.php. E.g. for org.codehaus.plexus:plexus-component-api I search with the following the XML snippet:
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-api</artifactId>
<version>1.0-alpha-16</version>
</dependency>
but this didn't yield any result.
You can use copy goal of dependency-plugin for download and copy artifacts:
mvn org.apache.maven.plugins:maven-dependency-plugin:3.3.0:copy \
-Dartifact=org.codehaus.plexus:plexus-component-api:1.0-alpha-16:jar \
-DoutputDirectory=.
You can also download manually from Maven Central repository, eg:
https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/

Maven Local file installation

I am trying to install a local jar file to be used as a dependency using the following command
mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=<path-to-file>
Getting the following result
The goal you specified requires a project to execute but there is no POM in this directory
To install the file in the local maven repository, you have to provide also the group ID, artifact ID, and the version for that file. Without them, Maven does not know in what directory to store the file.
See also: https://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html.
Maven need the so called GAV coordinates: groupId, artifactId, version and packaging to store the artefact.
You can name them wiht the install command
mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file
-Dfile=<path-to-file>
-Dpackaging=jar
-DgeneratePom=true
-DgroupId=<groupId> -DartifactId=<artifactId> -Dversion=<version>

Using mvn get to pull latest artifact from Nexus repository

I am trying to pull the latest artifact from my Nexus repository. I am using the get command to pull the artifact.
mvn dependency:get -Durl=http://nexus-repository:8080/nexus/content/repositories/snapshots -Dartifact=com.my.company:common:LATEST-Dtransitive=false -Ddest=. -s settings.xml
And it is the error message I am getting.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:get (default-cli) on project standalone-pom: Couldn't download artifact: Failed to resolve version for com.my.company:common:jar:LATEST: Could not find metadata com.my.company:common/maven-metadata.xml in releases (http://nexus-repository:8080/nexus/content/repositories/releases)
I do not know either why it is looking on release and not in snapshots because the version is on my snapshots repository.
When I run with the specific version everything works fine:
mvn dependency:get -Durl=http://nexus-repository:8080/nexus/content/repositories/snapshots -Dartifact=com.my.company:common:1.0.0-SNAPSHOT -Dtransitive=false -Ddest=. -s settings.xml
I will like to pull the latest version using mvn command and not curl neither wget.
Any recommendation or idea?

Missing parent pom for Intuit's Java V3 SDK for QBO

I'm updating to the latest version (2.3.2) of the Java V3 SDK for QBO. Following the instructions on the IPP developer site, I'm running into issues on Step 5: Install the Dependencies.
I checked out the sample application (which uses a deprecated version of the API) as listed in the documentation. After modifying the the maven install commands listed in the documentation to match the versions in the sample application, I can install the deprecated SDK dependencies:
## ipp-v3-java-devkit-2.0.1-jar-with-dependencies.jar
mvn install:install-file
-DgroupId=com.intuit.code.devkit.v3
-DartifactId=ipp-v3-java-devkit
-Dversion=2.0.1
-Dpackaging=jar
-Dfile=./QuickbooksV3API-Java/QuickbooksV3API/src/main/resources/dependencies/ipp-v3-java-devkit-2.0.1-jar-with-dependencies.jar
## ipp-java-qbapihelper-1.2.0.jar
mvn install:install-file
-DgroupId=com.intuit.code.devkit.qbhelper
-DartifactId=ipp-java-qbapihelper
-Dversion=1.2.0 -Dpackaging=jar
-Dfile=./QuickbooksV3API-Java/QuickbooksV3API/src/main/resources/dependencies/ipp-java-qbapihelper-1.2.0.jar
At this point I am able to run the sample application and successfully connect to QBO via the API.
Now that I've downloaded the latest IPP V3 Java SDK (24MB download) provided in the documentation the maven install command fails:
## ipp-v3-java-devkit-2.3.2-jar-with-dependencies.jar
mvn install:install-file
-DgroupId=com.intuit.code.devkit.v3
-DartifactId=ipp-v3-java-devkit
-Dversion=2.3.2
-Dpackaging=jar
-Dfile=./ipp-v3-java-devkit-2.3.2-jar-with-dependencies.jar
Resulting in:
[ERROR] The project com.intuit.code.devkit.v3:ipp-v3-java-devkit-pom:2.3.3-SNAPSHOT
(C:\...\JavaV3SDK2.3.2\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find
com.intuit.sb.tool.build.parent-pom:sb-parent-pom:pom:5.0.2
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 and
'parent.relativePath' points at wrong local POM # line 4,
column 10 -> [Help 2]
I've searched high and low for this parent POM artifact to no avail: com.intuit.sb.tool.build.parent-pom:sb-parent-pom:pom:5.0.2
Should the latest SDK download include the parent POM or am I missing something else?
I've installed the latest devkit(2.3.2) in my local maven repo.
It looks like a caching issue.
Please check if you have the devkit jar in the local repo.
<root>\.m2\repository\com\intuit\code\devkit\v3\ipp-v3-java-devkit\2.3.2
If you still face this issue, you can try deleting the above '2.3.2' folder and install it again.
mvn install:install-file -DgroupId=com.intuit.code.devkit.v3 -DartifactId=ipp-v3-java-devkit -Dversion=2.3.2 -Dpackaging=jar -Dfile=C:\ipp-v3-java-devkit-2.3.2-jar-with-dependencies.jar
Thanks
Place the updated jar (ipp-v3-java-devkit-2.3.2-jar-with-dependencies.jar) alongside the previous one in the sample application, specifically: QuickbooksV3API-Java\QuickbooksV3API\src\main\resources\dependencies\
Now run maven install as before, just change the version numbers:
mvn install:install-file
-DgroupId=com.intuit.code.devkit.v3
-DartifactId=ipp-v3-java-devkit
-Dversion=2.3.2
-Dpackaging=jar
-Dfile=./QuickbooksV3API-Java/QuickbooksV3API/src/main/resources/dependencies/ipp-v3-java-devkit-2.3.2-jar-with-dependencies.jar
While I'm not exactly sure why this works, I assume it has something to do with resources in paths relative to the jar itself.
The problem weird. apperantly what it looks like is the pom.xml inside dev-ki that comes along is broken.
When you run any command in the devkit directory, it uses that pom.xml within the devkit,and fails.
what I did was I went one directory up, and then tried importing the jar again. something like this -
mvn install:install-file -DgroupId=com.intuit.code.devkit.v3
-DartifactId=ipp-v3-java-devkit -Dversion=2.3.2 -Dpackaging=jar -Dfile=devkit/ipp-v3-java-devkit-jar-with-dependencies-2.4.0.jar
Interestingly this works. All of my developer jars are kept in dev-kit.
the devkit pom.xml had issues with parent module and child module, What it looks like is that the pom is just for reference, and not for execution.
-Hope this helps.

my OS is windows7,i want to build the developing environment of sakai oae

my OS is windows7,i want to Deployment the environment of sakai oae
When I run
mvn deploy:deploy-file -DgroupId=com.oracle-jdbc-6 -DartifactId=ojdbc6 -Dversion=10.2.0.1.0 -Dpackaging=jar -Dfile=org.sakaiproject.nakamura.ojdbc.jar -Durl=url -DrepositoryId=repositoryId
I got the error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
deploy-file (default-cli) on project org.sakaiproject.nakamura.ojdbc6: No transf
er protocol found. -> [Help 1]
i don't know Why.
You are trying to install the oracle jdbc jar to your local repo. Don't do this from within the OAE source that contains a POM as it will try to read the POM and it gets confused. Just do it from a new directory and it should be installed in your local repo.
Have a look at the bottom of this page for more info about running the mvn deploy plugin to install jars into your local repo:
http://maven.apache.org/plugins/maven-deploy-plugin/usage.html

Resources