Published: Feb 21, 2019 by Isaac Johnson
Nexus is used as a medium between components.
Repositories:
- Plugin: where to fetch build plugins
- Repository: similar to above, where to find plugins, parent poms, etc
- Distribution repository: where to transmit built things. If you define a distributionManagement block with repository and snapshotRepository, maven will pick the right target based on project.version (if it ends in “-SNAPSHOT”)
Group repositories merge things. An order is defined in nexus allowing overrides.
Proxies will serve a local cache if available, otherwise reach out to a remote repository.
One can proxy any remote repository. You can use scheduled tasks, smart proxies and release steps to force proxy syncs, however you can also set up a remote proxy with syncing disabled (to fix versions).
A Nexus Proxy server is still a nexus server and can host locally built artifacts (e.g. nextrel-dev)
Distribution
The distributionManagement block is only set up with snapshots. However one will need to provide a settings.xml file with username and password defined.
One can do this a few ways.
- Pass in -Dusername=xxx -Dpassword=xxx and reference them in a file
- Set environment variables and use ${ENV.NEXUS_USER} and ${ENV.NEXUS_PASS}
- Dynamically generate one (eg. gensettings.ps1)