Issue
I have maven projects and I want to deploy my artifacts on internal nexus repository which is configured to have my snapshots and releases on two separate places. So I can not use 'distributionManagement' as this would hardcode the location. So I have defined couple of in my settings.xml say 'releaseRepository' and 'snapshotRepository' and each have parameter 'release' which should be set to 'true' for releases and 'false' for snapshots.
I am running my build with following command to release my artifacts;
mvn clean deploy -DaltDeploymentRepository=releaseRepository::<DON'T KNOW WHAT GOES HERE SO LEFT IT EMPTY>::htp://abc.com/repositores/my-releases/ -Drelease=true
Now when I am running above command it fails because value for 'layout' is not provided and I get exception and build fails.
I couldn't find any information on what should be the value for 'layout', I have around 10 projects which I want to build and release after one another.
Solution
altDeploymentRepository
String
- Specifies an alternative repository to which the project artifacts should be deployed ( other than those specified in<distributionManagement>
). Format:id::layout::url
— (source)
So, in you case: releaseRepository::default::http://your.repo.url
(see here for layout).
Answered By - user180100
Answer Checked By - Candace Johnson (JavaFixing Volunteer)