The following Groovy 2.0 script is a mechanism for providing http access to file inside a network to which you only have ssh access.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
An example use case
- Configure your build or maven setting by adding localhost:8888 as a new repository.
- Set targetUrl to the base location of your internal maven repository i.e. http://repo1.maven.org/maven2/
- Update sshCommand providing your username and server location i.e. ssh root@dcmcfarland
- Run: groovy VertxMavenRelay.groovy
- To test everything is working access http://repo1.maven.org/maven2/com/google/inject/guice/ open your browser and go to http://localhost:8888/com/google/inject/guice/ the file listings for guice should display. If you now run a maven build maven will be able to access files in the internal repository.
N.B. If ssh-keys have not been configured to provide passwordless ssh access, the terminal in which VertxMavenRelay is running will request your password every time a http request is made.
See you next time.