0

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?

  • just putting them in the repository is not enough, have a look at `mvn install` – jhamon Nov 14 '18 at 09:06
  • Possible duplicate of [How to add local jar files to a Maven project?](https://stackoverflow.com/questions/4955635/how-to-add-local-jar-files-to-a-maven-project) – jhamon Nov 14 '18 at 09:09
  • If you need to do this repeatedly, it might be best to install a local repository server (eg Sonatype Nexus or JFrog Artifactory) that can download whitelisted packages from the internet, or where that is manually done by an administrator. – Mark Rotteveel Nov 14 '18 at 16:49

2 Answers2

0

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

0

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.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
  • I am currently trying to do mvn install:install-file -o -Dfile="path to jar file" -DpomFile="path to pom file" but this gives me the same kinds of errors. Is there a way to see which files I can install first? I am aware that i will have to install a LOT of files this way but in any case it won't take as long as waiting for the IT service to help me out with this... – Alexander Vandenberghe Nov 14 '18 at 09:21
  • It is important that you really try to build the project in Eclipse, e.g. with `clean package`. The console output of the build is the "real" situation - missing dependencies that are shown with red bubbles in the Eclipse IDE may or may not be real. – J Fabian Meier Nov 14 '18 at 09:26
  • Thanks for your help! fortunately it seems that i'm not the first one to complain about this and they're willing to whitelist the maven repository so I can hopefully soon build it the normal way! – Alexander Vandenberghe Nov 14 '18 at 09:39