Skip to content

Instantly share code, notes, and snippets.

@naartjie
Last active October 6, 2020 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naartjie/75b05218284b2e4bea5e9b4841763322 to your computer and use it in GitHub Desktop.
Save naartjie/75b05218284b2e4bea5e9b4841763322 to your computer and use it in GitHub Desktop.
Maven(-sucks)

Download a dependency

mvn dependency:get \
  -Dartifact=org.springframework.cloud.stream.app:mongodb-sink-kafka-10:1.3.1.RELEASE:jar \
  -Dtransitive=false \
  -Ddest=gfy.jar

This way you can "force" Nexus to download a dependency from upstream, for example.

If you're behind a corporate proxy, with TLS weirdness going on, add this for good measure:

-Dmaven.wagon.http.ssl.insecure=true

Adding a global mirror

~/.m2/settings.xml:

<settings>
  <mirrors>
    <mirror>
      <id>thanks-bob</id>
      <url>https://a-well-meaning-corpo.com/nexus/repository/public</url>
      <mirrorOf>*</mirrorOf>
    </mirror>
  </mirrors>
</settings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment