I have troubles designing the architecture of a couple of Maven repositories.
We maintain an infrastructure for our own company and a couple of clients. We have company internal components, redistributable components and customer-specific components. We also have company-internal SCM/CI/Nexus repo, as well as per-client SCM/CI/Nexus repo.
Now the hard part: We would like the redistributable components to be deployed in both our company repository and the client-specific repositories, when we release or deploy (because the customer components depend on the redistributable ones). It is required however, that the customers don't see each other's repository configurations (or our internal repo configuration) in the redistributable code. This means that the redistributable pom.xml may not contain the definitions of those repositories, otherwise each customer can see everything in the source code. Furthermore, download requests for internal artifacts or client components should not be sent across the board, otherwise each customer can see the requests in the Nexus logs of their repository.
How can this be achieved?
I know that there is a workaround, where distributionManagement is not specified at all in the pom.xml and I can use -DaltDeploymentRepository
from the command line, but I don't want to type in the URLs every time I deploy. Is there a better way?
Short Summary:
Company internal repo
- internal components
- redistributable components
Client 1 repo
- redistributable components
- client 1 app
Client 2 repo
- redistributable components
- client 2 app
The redistributable components should be deployed in all repos on release. Clients should not see repo configuration for other clients or internal ones.