I want to use ws4j for my project. And i can't able to connect to the internet all the time. So, most of time i download dependency to local repository using dependency:get command. Then i use it in project.
like that i tried download ws4j-1.0.1. But i get a error while downloading. It says Missing POM for edu.cmu.lti:ws4j:jar:1.0.1. But there is a pom file in the repository. see the url ws4j repository. But why i get the error.
The command i used was mvn dependency:get -Dartifact=edu.cmu.lti:ws4j:1.0.1
The image of the error i get
I am using maven version 3.6.3
Please, someone help to solve this issue.
mvn dependency:get -Dartifact=edu.cmu.lti:ws4j:1.0.1
This tries to download the dependency from https://repo.maven.apache.org/maven2/ and since it does not find the dependency there, it fails.
You need to specify "-DremoteRepositories" to fetch it from a remote repository.
For example: mvn dependency:get -Dartifact=org.apache.maven:maven-core:2.2.1:jar:sources -DremoteRepositories=https://repo.maven.apache.org/maven2 -Ddest=/tmp/myfile.jar
Please refer https://maven.apache.org/plugins/maven-dependency-plugin/usage.html
Related
I've just started helping my professor out for his research project and I'm trying to get it set up on my local windows computer. I'm stuck with this error:
Failed to execute goal on project tornado: Could not resolve
dependencies for project tornado:tornado:jar:0.0.1-SNAPSHOT: Failure
to find com.disco:disco:jar:10.2.0 in http://clojars.org/repo was
cached in the local repository, resolution will not be reattempted
until the update interval of clojars.org has elapsed or updates are
forced
Notes:
It's a maven project being run on eclipse.
I've tried multiple ways of adding the disco-2.0.jar file to the build path but I'm not sure if that's what I'm meant to be doing or if it's even the right file, although I haven't found any other disco file within the project directories.
I've tried mvn clean install -U to see if it may just have been a problem with resetting the maven project.
Well the log reads is clear and you could verify it as well:
Failure to find com.disco:disco:jar:10.2.0 in http://clojars.org/repo
If you navigate to the https://clojars.org/repo/com/ there is no disco.jar available there. Hence the failure.
Probably this could be some local jar that might need to be build either locally or required by its owner to be pushed(mvn deploy) to clojars in another case.
Also mvn clean install -U help you fetch the latest of SNAPSHOT, in your case this would fetch the latest tornado:tornado:jar:0.0.1-SNAPSHOT but that fails further sicne it specifies the com.disco:disco:jar:10.2.0 as dependency which is not found anywhere for your build to proceed.
You need to make the disco-2.0.jar available from a Maven repository. If you have a Nexus or Artifactory, upload it there. Alternatively, you can install it into the local repository of your computer using the install:install-file goal.
Furthermore, it is possible to define local directories as additional Maven repositories, see https://stackoverflow.com/a/28762617/927493.
I'm going to access a database using OJDBC. My project is a Java play project and using SBT. I added,
"com.oracle" % "ojdbc14" % "10.2.0.4.0"
But when I'm compiling the project with this,
It says,
::::::::::::::::::::::::::::::::::::::::::::::
[warn]:: FAILED DOWNLOADS ::
[warn]:: ^ see resolution messages for details ^ ::
[warn]::::::::::::::::::::::::::::::::::::::::::::::
[warn]:: com.oracle#ojdbc14;10.2.0.4.0!ojdbc14.jar
[warn]::::::::::::::::::::::::::::::::::::::::::::::
Also I tried to download the jar manually using this link. Then I got 404.
Is there a way to add the OJDBC14 dependency to a Java play project?
For the maven users (like me) who are trying to download the jars from maven repo: Stop!
The jar's metadata is indexed and pom file is available on maven central but the actual jar is not available. Try clicking on the download link:
http://mvnrepository.com/artifact/com.oracle/classes12/10.2.0.2.0
http://mvnrepository.com/artifact/com.oracle/ojdbc14/10.2.0.4.0
So, you need to get the jar from http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html
And then install to your local repo.
mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 \
-Dversion=10.2.0.4.0 -Dpackaging=jar -Dfile=ojdbc.jar -DgeneratePom=true
In SBT's config add
resolvers += Resolver.mavenLocal to enable local maven repo
P.S.: If you are still reading it: I wish oracle deployed them on maven, (with a note stating if you are using the jar means you are agreeing our terms)!
You can download ojdbc.jar in the following link
http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html
Maven repo does not offer a ojdbc jar link, because oracle Unauthorized
Oracle has a Maven repository now. https://blogs.oracle.com/dev2dev/get-oracle-jdbc-drivers-and-ucp-from-oracle-maven-repository-without-ides
This is the error that I am getting with my current Maven Android Project.
The POM for com.google.android.gms:google-play-services:jar:13.0.0 is missing, no dependency information available
I have tried reinstalling google play services from SDK Manager and running mnv clean install still it does not work.
Any idea how to resolve this.
you need to make sure maven can access the repository the artifact can be found in. For example maven central http://search.maven.org/ does not contain the that artifact.
I would expect a settings.xml or a pom.xml to contain some section in that define where to look for this.
if you can execute maven commands try: mvn help:effective-settings
and as well: mvn help:effective-pom
that should reveal some repositories.
Another issue may be that you need to configure a proxy server for maven if you are behind one.
Is the message a warning or an error? Because it is also common that some artifacts do not have a pom.xml. So if it is a warning but everything else works just ignore it :)
Is there a way add artifact to local maven repository from my eclipse project?
currently i have a project that contain many jars, and i have started using maven. what i need is to add all these jars to the local repository in an automated way without redownload them or adding them one by one and specifying their coordinates.
Make a new Maven project in Eclipse, and add all your code to the src/main directory. Now you will have lots of compile errors, because of missing dependencies.
Now start auto adding the dependencies. In Intellj you can add something using alt-enter, which also has the option to "add maven dependency". This adds that dependency from the maven repository to the pom. I do not know eclipse well enough, but it probably also has this feature.
Now, in a normal project, you will find most of your required dependencies somewhere in Maven Central. If you miss any, you can add them using manual installation to your local repository, as suggested by Manas Mukherjee
mvn install:install-file -Dfile={jar_file_name_path}.jar -DgroupId={groupId}
-DartifactId={artifactId} -Dversion={version} -Dpackaging=jar
you can write a script using mvn install command.
mvn install:install-file -Dfile={jar_file_name_path}.jar -DgroupId={groupId}
-DartifactId={artifactId} -Dversion={version} -Dpackaging=jar
You can add all dependencies in pom file as well
Thanks
I have a JAR which can't be found in the Maven Repositories.
So that I use the following command to install into my local repositories
install:install-file -Dfile=C:/FIXApplication/lib/quickfixj-all-1.5.2 -DgroupId=org.quickfixj -DartifactId=quickfixj -Dversion=1.5.2 -Dpackaging=jar -DgeneratePom=true
And the result is successful and I can find the folder under the .m2\repository\org\quickfixj\quickfixj
But when I modify the pom.xml to add the dependency.
It said:
Missing artifact org.quickfixj:quickfixj:jar:1.5.2
Why this happen? Why can't read the local repositories?
Though the command did not error, it is quite likely that the local repository does not have the artifact.
Your command has this part
-Dfile=C:/FIXApplication/lib/quickfixj-all-1.5.2
It should have been
-Dfile=C:/FIXApplication/lib/quickfixj-all-1.5.2.jar
Perhaps you can make this change, try again and see if it works.