You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to refactor our pipelines and I'd like to remove the repositories section from the projects POMs and instead rely on what is configured in single settings.xml that can be used everywhere.
This simplifies our POMs as we have lots of repositories where these repository configuration is duplicated.
I'm using s4u/maven-settings-action to setup the settings.xml file, which by creates /home/runner/.m2/settings.xml
WARN - No M2 folder '/home/runner/.m2' found. We therefore won't beneficy from the CI cache
Current branch: main
Release branch name: main
We are on the release branch
Using SSH folder /root/.ssh
Using M2 repository folder /home/runner/.m2
ls: /home/runner/.m2: No such file or directory
/home/runner/.m2 is empty, this means we didn't hit a potential M2 cache :(
Which does seem to then pick up the directory from looking at the logs:
INFO - M2 folder '/github/workspace/.m2' not empty. We therefore will beneficy from the CI cache
Current branch: main
Release branch name: main
We are on the release branch
Using SSH folder /root/.ssh
Using M2 repository folder /github/workspace/.m2
However, that still doesn't seem to work as it is unable to pull any artifacts from custom repositories.
I've tried locally to run mvn -B release:prepare release:perform (after deleting my ~/.m2/repository) with the exact same settings.xml generated by s4u/maven-settings-action, no <repositories> section in my pom.xml and it works fine.
Any ideas how I could get this to work?
The text was updated successfully, but these errors were encountered:
I have just noticed that we've also got a distributionManagement section one of our parents, and when I ran it locally it only published the artifacts to the single repository configured there (but picking up credentials from ~/.m2/settings.xml) so potentially there is still something that would need to be set in a pom somewhere in the hierarchy.
Unless you can think theres something I'm missing, as a workaround for my use case I might pivot to a manual script along the lines of (untested):
VERSION=$(mvn ...)
mvn versions:set -DremoveSnapshot
git commit -am "[ci skip] prepare release $VERSION"
git tag $VERSION
mvn deploy -DaltDeploymentRepository=customRepoId::customRepoUrl
mvn versions:set -DnextSnapshot=true
git commit -m "[ci skip] prepare for next development iteration"
git push ...
Hi,
I am attempting to refactor our pipelines and I'd like to remove the
repositories
section from the projects POMs and instead rely on what is configured in single settings.xml that can be used everywhere.This simplifies our POMs as we have lots of repositories where these repository configuration is duplicated.
I'm using s4u/maven-settings-action to setup the settings.xml file, which by creates
/home/runner/.m2/settings.xml
I've tried to configure this action as follows:
and in the logs I get:
I've also tried:
Which does seem to then pick up the directory from looking at the logs:
However, that still doesn't seem to work as it is unable to pull any artifacts from custom repositories.
I've tried locally to run
mvn -B release:prepare release:perform
(after deleting my~/.m2/repository
) with the exact same settings.xml generated bys4u/maven-settings-action
, no<repositories>
section in my pom.xml and it works fine.Any ideas how I could get this to work?
The text was updated successfully, but these errors were encountered: