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

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.

Related

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>

maven: local installed jar not found

I'm getting this error message:
Could not resolve dependencies for project com.psgd.template:backend:war:1.0.0: Could not find artifact com.oracle:ojdbc7:jar:12.1.0.2
I've previously installed this library into local repository using:
mvn install:install-file \
-DgroupId=com.oracle \
-DartifactId=ojdbc7 \
-Dversion=12.1.0.2 \
-Dpackaging=jar \
-Dfile=ojdbc7-12.1.0.2.jar \
-DgeneratePom=true
I've look up into my repository:
$ ls -Rh ~/.m2/repository/com/oracle/
/home/jeusdi/.m2/repository/com/oracle/:
ojdbc7
/home/jeusdi/.m2/repository/com/oracle/ojdbc7:
12.1.0.2
/home/jeusdi/.m2/repository/com/oracle/ojdbc7/12.1.0.2:
ojdbc7-12.1.0.2.jar.lastUpdated ojdbc7-12.1.0.2.pom.lastUpdated
So, it's present into local repository.
Any ideas?
Many things can go wrong here.
When you run mvn install:install-file you should see the log line in command line: something like : INFO Installing file ... to full <<PATH_COMES_HERE>>
So check that path.
If everything works as expected you should be able to see both pom.xml and the jar in the corresponding folder of your repository, not "lastUpdated" I believe.
I don't see it in the provided snippet...
You can also check permissions as one possible source of issues.
The last thing is checking the actual pom generated by install:install-file. Make sure, the pom is valid and contains the information you've entered.
You can also delete the whole folder from maven repo and re-run mvn install:install-file maybe the repo went corrupted for some reason who knows.
The files
ojdbc7-12.1.0.2.jar.lastUpdated ojdbc7-12.1.0.2.pom.lastUpdated
mean that the Maven looked for the pom and did not find it. It is a kind of cache for missing artifacts.
Please delete these two files and try again to install the jar. Then try again to build against it.

Installing current version of DWR via Maven

I checked out current SVN Snapshot of DWR (3.0.0-rc3-SNAPSHOT) and I am unable to mvn install it - the pom.xml seem to be configured not for such command. What is the correct way of installing DWR into maven repo?
I also tried copying files from https://oss.sonatype.org/content/repositories/snapshots/org/directwebremoting/dwr/3.0.0-rc3-SNAPSHOT/ and mvn installing them as well. This way obviously does not work either. How can it be installed from here? I don't want to link to the snapshot directory directory from my pom.xml as I don't want to get unexpected results when new snapshot is introduced.
I'm not sure if I get you correctly, but you can always download the JAR and install it locally using Maven. Something like this:
mvn install:install-file -Dfile=dwr-3.0.0-rc3-20130514.180049-1.jar -DgroupId=org.directwebremoting -DartifactId=dwr -Dversion=3.0.0-rc3-SNAPSHOT -Dpackaging=jar
more on the Maven info here:
http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
EDIT:
I managed to install it from source as well by do SVN checkout:
svn co https://svn.directwebremoting.org/dwr/trunk/
My first attempt to build it failed because I was using Maven 2.x. Seems like DWR is using Maven enforcer plugin to enforce certain Maven version. I didn't check which version is really required but by updating my Maven to Maven3 I managed to install it.

mvn clean install, mvn install:install-file order?

I am learning maven and trying to understand the order of things. As I understand, mvn clean install builds the repository with the default jars, where install produces a .zip that I will need later.
I want to use my custom jars which I call mvn install:install-file, but when I run this before install, I get some cannot find symbol errors. I am assuming my custom jars (which don't contain these classes) overwrites some default jars? I can't find these classes anywhere on my filesystem, so I am assuming they are already packaged in 1 of the default jars. How can I get around this?
Also, which order should I do things? All I want is the final .zip, that includes the custom jars?
mvn install -- builds and packages the source code and copies ( installs ) the artifact to your local repository which is $USER_HOME/.m2/repository
It's hard to say what's happening there without looking at the command you typed in, and the error trace that you received. That said, install-file is to copy an artifact to your local repo at appropriate hierarchy. It's nothing more than that. The correct syntax would be:
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
-DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>
Usually, you just need to run install:install-file for all the custom dependencies once, and before you execute the mvn install.
If your custom jars have same coordinates -- artifactid, groupid, and version as some of the dependencies in your pom.xml and your custom jars do not have the classed that your source code uses -- well, you get the error.
refer: http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
Regarding to the maven-install-plugin website they mention as the following: -
install:install-file: is mostly used to install an externally created artifact into the local repository, along with its POM. In that case the project information can be taken from an optionally specified pomFile, but can also be given using command line parameters.
This means the artifact should be created before using this command. If you would like to deploy your fresh compiled code to the local repository, please just use the mvn clean install.
Please look at the Introduction to the Build Lifecycle for further information about the sequence and lifecycle. I hope this may help.
Regards,
Charlee Ch.

Where can I get the NaturalDocs Maven plugin?

The maven configuration mentioned in the Usage section of the Natural Docs Maven Plugin site:
<groupId>org.codehaus.mojo.naturaldocs</groupId>
<artifactId>naturaldocs-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
However; I can't seem to find any version in any Maven repository including Maven Central or the Snapshot repo.
I was able to find what seems like the initial version attached to this Mojo plugin submission but it only includes source, and while it's nice to look at I don't wish to compile it for use myself.
Grab the source archive that you referenced and unzip it in a convenient spot.
From that folder, run:
mvn clean install
Assuming that runs without issue, run:
mvn install:install-file -Dpackaging=jar -Dfile=target\naturaldocs-maven-plugin-1.0-SNAPSHOT.jar -DgroupId=org.codehaus.mojo.naturaldocs -DartifactId=naturaldocs-maven-plugin -Dversion=1.0-SNAPSHOT
Assuming that runs fine, check the local deploy works as expected by including the pom reference in your project.
<dependency>
<groupId>org.codehaus.mojo.naturaldocs</groupId>
<artifactId>naturaldocs-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
If your project build without issue, then deploy it to your local Maven repo by running:
mvn deploy:deploy-file -Dpackaging=jar-Drepository=extNonFree -Durl=scpexe://maven.your-company.com/your-serverpath/maven/proximity/ext-non-free/storage -Dfile=target\naturaldocs-maven-plugin-1.0-SNAPSHOT.jar -DgroupId=org.codehaus.mojo.naturaldocs -DartifactId=naturaldocs-maven-plugin -Dversion=1.0-SNAPSHOT
Or have one of your local Maven admins deploy the pom and jar manually.
I hope that helps.

Resources