Add maven source plugin if not exists on maven-publish
This commit is contained in:
parent
f163e77124
commit
b25cde5c2d
23
.github/workflows/maven-publish.yml
vendored
23
.github/workflows/maven-publish.yml
vendored
@ -93,6 +93,28 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
CODEARTIFACT_AUTH_TOKEN: ${{ secrets.AWS_CA_TOKEN }}
|
||||
|
||||
- name: Add maven-source-plugin to POM
|
||||
run: |
|
||||
if ! grep -q "maven-source-plugin" pom.xml; then
|
||||
echo "maven-source-plugin not found in pom.xml, adding it..."
|
||||
sed -i '/<plugins>/a \
|
||||
<plugin>\
|
||||
<groupId>org.apache.maven.plugins</groupId>\
|
||||
<artifactId>maven-source-plugin</artifactId>\
|
||||
<version>3.3.1</version>\
|
||||
<executions>\
|
||||
<execution>\
|
||||
<id>attach-sources</id>\
|
||||
<goals>\
|
||||
<goal>jar-no-fork</goal>\
|
||||
</goals>\
|
||||
</execution>\
|
||||
</executions>\
|
||||
</plugin>' pom.xml
|
||||
else
|
||||
echo "maven-source-plugin already exists in pom.xml"
|
||||
fi
|
||||
|
||||
- name: Upload snapshot to nexus
|
||||
run: |
|
||||
GROUP_ID=$(mvn help:evaluate -Dexpression="project.groupId" -q -DforceStdout)
|
||||
@ -126,3 +148,4 @@ jobs:
|
||||
|
||||
env:
|
||||
NEXUS_ADMIN_PASSWORD: ${{ secrets.NEXUS_ADMIN_PASSWORD }}
|
||||
CODEARTIFACT_AUTH_TOKEN: ${{ secrets.AWS_CA_TOKEN }}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user