installing microsoft sqljdbc driver with maven - java

I have a maven project and i need to add dependency to Microsoft sqljdbc driver.
I have followed the steps shown in this article here
but when i try to do the fist step i get the following error
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\soft\sqljdbc_4.1\
enu). Please verify you invoked Maven from the correct directory. -> [Help 1]

I found the solution for the issue. We need to give all the arguments wrapped in double quotas "" like this
mvn install:install-file "-DgroupId=com.microsoft.sqlserver" "-DartifactId=sqljdbc41" "-Dversion=4.1" "-Dpackaging=jar" "-Dfile=sqljdbc41.jar"
Then only maven will install the file without a pom file
Answer in this question helped me

Related

Cannot build codeobe integration sample

I tried to build my own integration project by following codeobe sample found in this repo. However my build fails with following error:
[ERROR] Failed to execute goal on project fingerprint_service: Could not
resolve dependencies for project
org.daniel.integration:pizza_service:jar:1.0.0: Could not find artifact
org.codeobe.integration:codeobe-java-sdk:jar:1.0.0 in central
(https://repo.maven.apache.org/maven2) -> [Help 1]
Can someone please help, Thanks in advance
The Codeobe FAQ says this:
How to install codeobe sdk
Download SDK from our website and use following command to install locally
mvn install:install-file -Dfile=codeobe_sdk-1.0.0.jar \
-DgroupId=org.susi.integration -DartifactId=codeobe_sdk
-Dversion=1.0.0 -Dpackaging=jar
Try it. If it doesn't work, reach out to the Codeobe team for clearer instructions on what to do.
I am from team Codeobe & Stephen C is correct. Although we have a slight change.
Please use the command as follows.
$ mvn install:install-file -Dfile=codeobe-java-sdk.jar -DgroupId=org.codeobe.integration -DartifactId=codeobe-java-sdk -Dversion=1.0.0 -Dpackaging=jar
You can follow our official documentation for SDK using this link.
If you need more help please feel free to ask it here.
Thanks

Failed to execute goal on project.. Failed to read artifact descriptor for error in IntellJ

I imported my project and when did a maven clean build was successful, but when maven install is done this Build Failure occurs.
I have my maven in C\maven\maven 3.6 and I have given the settings and repo location of that location to this project.
My Env variables are correctly set up with reference to Java and Maven as well. Please help me on this to get it solved.
it may be because of the proxy ! Check you proxy and test if it's working.

Jenkins: build failing because of third party jar : Could not find artifact com.oracle:ojdbc7:jar:12.1.0.1.0

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.

Can't install hadoop2.8.0 correctly

I used Maven to install Hadoop 2.8.0,but it always says build failure.
Here's the error message:
[ERROR]Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:copy-resources (copy-resources) on project hadoop-build-tools: Cannot create resource output directory : ~/hadoop-build-tools/target/extra-resources -> [Help 1]
I checked help1 and it says MojoExecutionException is not generated by the Maven core itself but a plugin. It seems that the pom.xml needs to be corrected,but could you please help me how to revise it? Or any ideas how to resolve this?

Maven command to download latest version of a jar

We have a process to update part of a build that is not in Maven yet but will be soon. Once built, we manually put the jar in Nexus and then update the pom files that are in SVN. Works fine and doing a "mvn clean install" pulls down the new .jar and creates a new folder in my local repository etc. Grand.
Now I would like to be able to get any new version that has been uploaded by making a mvn call without doing a build (as with mvn install). I was looking at mvn dependency:get but it seems to have a lot of parameters that only gave me errors.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.1:get(default-cli) on project workflow-project: The parameters 'repositoryUrl' for goal org.apache.maven.plugins:maven-dependency-plugin:2.1:get are missing or invalid -> [Help 1]
I have tried adding the mentioned repositoryUrl param but it too gives me errors, not least about deprecation. Is this the correct goal? How is it most simply used if so?
Use the Maven Versions plugin. It has a ton of useful commands for managing dependency versions in a POM.
For example, you can run the following:
mvn versions:use-latest-versions
That command will replace versions in your POM with the latest version of artifacts. There are optional parameters you can pass to have more fine-grained control. For example, you can use the includes parameter to specify a particular artifact to update to the latest version.
Perhaps you would be happy with a
mvn compile
Which would load the dependencies and compile but go no futher. The only changes would be in target

Categories