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.
Related
Im trying to run maven on a linux server that does not have internet connectivity.
I installed maven but when I run "mvn compile" on my java project, it gets stuck trying to download plugins.
How do I get past it? Is there a place to get a full install with all plugins required so it dosent have to download anything?
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.apache.maven.plugins:maven-resources-plugin:jar:2.6 has not been downloaded from it before. -> [Help 1]
You can download all jars or import/move them already downloaded from another machine from userHome/.m2 to your ~/.m2 folder, and when you'll try to compile again it'll pull the libs/plugins from m2 folder without trying to download them.
No.
Running Maven does not make sense unless you are connected to a Maven repository.
If you have no internet connection then you need an internal Maven repository, i.e. a Nexus or Artifactory server in your company. Now this server does not only provide the dependencies for you, but also the plugins for Maven to run (of course, it has to get them somewhere from, so it needs some kind of connection to the internet).
I am trying to install OreKit (an orbital mechanics toolkit) to validate some code i've written. Orekit is a maven project and thus it tries to download all its dependencies from the maven repo.
Unfortunately my company has pretty strict internet security measures and the maven repo is not whitelisted. The only way to access non-whitelisted websites is through a secure browser (tightGate) which is basically a video-feed of the browser running on a server. Files downloaded in this browser can then be transfered to my computer using a separate program.
This of course means that the build fails. I have been trying to download all the dependencies manually and put them in the local repository.
example:
eclipse error: "Missing artifact junit:junit:jar:4.12"
I downloaded the corresponding jar and pom files (junit-4.12.jar and junit-4.12.pom) and put them into my local repository (C:/Users//.m2/repository/junit/junit/4.12/)
I did this for every error eclipse reported but nothing changes and the same errors are still there.
Am i doing something wrong here? Is it even possible to build a project this way or should i just give up already?
In principle, this could work, but it would be easier to use mvn install:install-file for the separate jars.
Be aware that the number of artifacts that Maven usually requires is > 100.
We also have strict regulations, but managed to get an extra server with a Nexus that proxies MavenCentral, so we can reach the artifacts through there.
to put jar file in your local maven repository, you must install it.
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
-DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>
get more info from https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
I don't understand following error I am getting while executing : mvn install
I have the javax.transaction:jta:jar:1.0.1B artifact in my m2 repository and I did make sure that the maven is looking at the right repository (By running mvn -X)
Has anybody ever experienced and resolved this kind of error.
Failure to find javax.transaction:jta:jar:1.0.1B 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
I had this same problem. The jar was installed in my local .m2 directory.
I had the pom.xml updated with the dependency element for the jar file.
I even added the localRepository element in a local settings.xml (even though this is the default and shouldn't be needed).
The authorities on the directories was what is required:
drwxr-xr-x on directories and -rw-r--r-- on the files in the respository
none of the other items in the list from the DependencyResolutionException were helpful
I decided to try running with sudo on the mvn install and this made the difference (I am on a mac if that matters):
sudo mvn install:install-file -DgroupId=com.nav.abc - DartifactId=xy.abc -Dversion=1.0.0 -Dpackaging=jar - Dfile=abcAdapter/xy.abc.jar
And now it seems to be working!
I don't see any difference in the access authorities on the directories so I'm not sure how this made any difference... but it does work
Since you say the jar is in your local .m2, it is strange that Maven still goes to the central repo to find it, ideally it should not. I am thinking it might be related to a different dependency, for example like in this thread. Could you check if yours if the same scenario?
The other thing you could do is look for a repository where this version of JTA exists and add that repository to your settings.xml or pom.xml, however you have that configured.
One another option is you could try with a different version of JTA jar and see if you run in to the same issue.
Go to the folder contains javax.transaction:jta:jar:1.0.1B in your .m2 and then delete this file _remote.repositories
I get the following error:
The following artifacts could not be resolved: com.sun.jdmk:jmxtools:jar:1.2.1, com.sun.jmx:jmxri:jar:1.2.1: Failure to find com.sun.jdmk:jmxtools:jar:1.2.1 in https://artifactory.corp.adobe.com/artifactory/maven-identity-snapshot was cached in the local repository, resolution will not be reattempted until the update interval of artifactory-snapshot
However, both jars are in the Maven cache (.m2 folder) on my machine. I mean files named: jmxri-1.2.1.jar and jmxtools-1.2.1.jar. They are respectively in the folders com/sun/jmdk/jmxtools/1.2.1/ and com/sun/jmx/jmxri/1.2.1
EDIT: When I try the -o switch on Maven to force it to use the local jars, it says the artifact has not been downloaded before. Which is probably true since indeed the artifact is not in the repo but was copied from some other place to my Maven cache -- is it possible to force Maven to use the jars? The -o switch does not seem to force this and Maven seems to be able to detect that the artifact was not downloaded.
Try to delete corresponding artifact folders in maven local repo and rerun or just rerun using -U flag.
Which is probably true since indeed the artifact is not in the repo but was copied from some other place to my Maven cache
Manually copying jars is not the correct way to put artifacts into maven local repo. You should use mvn install:install-file instead. More details here: Guide to installing 3rd party JARs
The dependency on those jars is usually a consequence of a bug in the pom.xml for log4j 1.2.15.
Update to 1.2.16 or 1.2.17 and you will not need these jars any longer.
These particular artefacts date back to a time when Sun licensing did not permit the hosting of the actual jars in a public maven repository.
You were required to accept licence conditions, download them yourself and then manually install either into your local repo (using mvn install:install-file) or into your corporate repository manager (typically using a UI that it provides or mvn deploy:deploy-file).
The problem: you have a zipped java project distribution, which depends on several libraries like spring-core, spring-context, jacskon, testng and slf4j. The task is to make the thing buildable offline. It's okay to create project-scope local repo with all required library jars.
I've tried to do that. Looks like even as the project contains the jars it requires for javac and runtime, the build would still require internet access. Maven would still lurk into network to fetch most of its own plugins it requires for the build. I assume that maven is run with empty .m2 directory (as this may be the first launch of the build, which may be an offline build). No, I am not okay with distributing full maven repo snapshot along the project itself, as this looks like an utter mess for me.
A bit of backround: the broader task is to create windows portable-style JDK/IntelliJ Idea distribution which goes along the project and allows for some minimal java coding/running inside IDE with minimal configuration and minimal internet access. The project is targeted towards students in a computer class, with little or no control over system configuration. It is desirable to keep console build system intact for the offline mode, but I guess that maven is overly dependent on the network, so I have to ditch it in favor of good old ant.
So, what's your opinion, could we move first maven build in offline mode completely? My gut feeling is that initial maven distribution just contains the bare minimum required to pull essential plugins off the main repo and is not fully functional without seeing the main repo at least once.
Maven has a '-o' switch which allows you to build offline:
-o,--offline Work offline
Of course, you will need to have your dependencies already cached into your $HOME/.m2/repository for this to build without errors. You can load the dependencies with:
mvn dependency:go-offline
I tried this process and it doesn't seem to fully work. I did a:
rm -rf $HOME/.m2/repository
mvn dependency:go-offline # lot of stuff downloaded
# unplugged my network
# develop stuff
mvn install # errors from missing plugins
What did work however is:
rm -rf $HOME/.m2/repository
mvn install # while still online
# unplugged my network
# develop stuff
mvn install
You could run maven dependency:go-offline on a brand new .m2 repo for the concerned project. This should download everything that maven needs to be able to run offline. If these are then put into a project-scope local repo, you should be able to achieve what you want. I haven't tried this though
Specify a local repository location, either within settings.xml file with <localRepository>...</localRepository> or by running mvn with -Dmaven.repo.local=... parameter.
After initial project build, all necessary artifacts should be cached locally, and you can reference this repository location the same ways, while running other Maven builds in offline mode (mvn -o ...).