Improve Maven commands

This commit is contained in:
Marcono1234 2021-05-04 13:35:37 +02:00
commit 4df52390d3

View file

@ -141,10 +141,10 @@ jobs:
java-version: '11' java-version: '11'
- name: Build with Maven - name: Build with Maven
run: mvn -B package --file pom.xml run: mvn --batch-mode --update-snapshots verify
- name: Publish to GitHub Packages Apache Maven - name: Publish to GitHub Packages
run: mvn deploy run: mvn --batch-mode deploy
env: env:
GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password
@ -160,7 +160,7 @@ jobs:
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Publish to Apache Maven Central - name: Publish to Apache Maven Central
run: mvn deploy run: mvn --batch-mode deploy
env: env:
MAVEN_USERNAME: maven_username123 MAVEN_USERNAME: maven_username123
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
@ -285,10 +285,10 @@ jobs:
settings-path: ${{ github.workspace }} # location for the settings.xml file settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Build with Maven - name: Build with Maven
run: mvn -B package --file pom.xml run: mvn --batch-mode --update-snapshots verify
- name: Publish to GitHub Packages Apache Maven - name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml run: mvn --batch-mode deploy --settings $GITHUB_WORKSPACE/settings.xml
env: env:
GITHUB_TOKEN: ${{ github.token }} GITHUB_TOKEN: ${{ github.token }}
``` ```