Skip to content

Commit 02b9b04

Browse files
committed
Add central profile to Maven settings in GitHub Actions workflow for improved credential management during deployment. This change activates the central profile by default and includes username and password properties for enhanced security.
1 parent 2dbc422 commit 02b9b04

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/pull-request.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,20 @@ jobs:
7171
<gpg.executable>gpg</gpg.executable>
7272
</properties>
7373
</profile>
74+
<profile>
75+
<id>central</id>
76+
<activation>
77+
<activeByDefault>true</activeByDefault>
78+
</activation>
79+
<properties>
80+
<central.username>\${env.MAVEN_USERNAME}</central.username>
81+
<central.password>\${env.MAVEN_PASSWORD}</central.password>
82+
</properties>
83+
</profile>
7484
</profiles>
7585
<activeProfiles>
7686
<activeProfile>gpg</activeProfile>
87+
<activeProfile>central</activeProfile>
7788
</activeProfiles>
7889
</settings>
7990
EOF
@@ -87,4 +98,4 @@ jobs:
8798
export MAVEN_PASSWORD="${{ secrets.MAVEN_PASSWORD }}"
8899
export GPG_PASSPHRASE=${{ secrets.GPG_PASSPHRASE }}
89100
90-
mvn clean deploy -Dgpg.keyname=$GPG_KEY_ID -Dgpg.passphrase=$GPG_PASSPHRASE --settings ~/.m2/settings.xml
101+
mvn clean deploy -Dgpg.keyname=$GPG_KEY_ID -Dgpg.passphrase=$GPG_PASSPHRASE -Dcentral.username=$MAVEN_USERNAME -Dcentral.password=$MAVEN_PASSWORD --settings ~/.m2/settings.xml

0 commit comments

Comments
 (0)