Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 0 additions & 70 deletions .github/workflows/maven-build.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/maven-mend-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Mend CLI scan for Maven PR

on:
workflow_run: # zizmor: ignore[dangerous-triggers]
workflows: ["Java CI with Maven"]
types: [completed]

permissions:
contents: read
actions: read
checks: write
pull-requests: write
security-events: write

concurrency:
group: mend-scan-${{ github.event.workflow_run.pull_requests[0].number || github.event.workflow_run.head_sha }}
cancel-in-progress: true

jobs:
scan:
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
uses: project-ncl/shared-github-actions/.github/workflows/mend-ci.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23
with:
project_name: "Commonjava/commonjava"
SCA: true
SAST: true
triggering_run_id: ${{ github.event.workflow_run.id }}
pr_feedback: true
secrets:
MEND_URL: ${{ secrets.MEND_URL }}
MEND_USER_KEY: ${{ secrets.MEND_USER_KEY }}
MEND_EMAIL: ${{ secrets.MEND_EMAIL }}
MEND_ORGNAME: ${{ secrets.MEND_ORGNAME }}
MEND_PRODUCTNAME: ${{ secrets.MEND_PRODUCTNAME }}
37 changes: 37 additions & 0 deletions .github/workflows/maven-mend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Mend CLI scan for Maven

on:
push:
branches:
- master
schedule:
- cron: "0 22 * * 0"

permissions:
contents: read
actions: read
checks: write
Comment thread
patrikk0123 marked this conversation as resolved.
Dismissed
pull-requests: write
Comment thread
patrikk0123 marked this conversation as resolved.
Dismissed
security-events: write
Comment thread
patrikk0123 marked this conversation as resolved.
Dismissed

jobs:
build:
uses: project-ncl/shared-github-actions/.github/workflows/maven-ci.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23
with:
java_version: "11"
build_command: "MAVEN_OPTS='-Xmx4096m -Xms2048m -XX:MaxMetaspaceSize=4096m -Xss8m' mvn -B -V clean verify -Prun-its -Pci"
upload_artifacts: true

call-mend-ci:
needs: build
uses: project-ncl/shared-github-actions/.github/workflows/mend-ci.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23
with:
project_name: "Commonjava/commonjava"
SCA: true
SAST: true
secrets:
MEND_URL: ${{ secrets.MEND_URL }}
MEND_USER_KEY: ${{ secrets.MEND_USER_KEY }}
MEND_EMAIL: ${{ secrets.MEND_EMAIL }}
MEND_ORGNAME: ${{ secrets.MEND_ORGNAME }}
MEND_PRODUCTNAME: ${{ secrets.MEND_PRODUCTNAME }}
16 changes: 16 additions & 0 deletions .github/workflows/maven-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Java CI with Maven

permissions:
contents: read

on:
pull_request:
branches: ["*"]

jobs:
call-maven-ci:
uses: project-ncl/shared-github-actions/.github/workflows/maven-ci.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23
with:
java_version: "11"
build_command: "MAVEN_OPTS='-Xmx4096m -Xms2048m -XX:MaxMetaspaceSize=4096m -Xss8m' mvn -B -V clean verify -Prun-its -Pci"
upload_artifacts: true
25 changes: 25 additions & 0 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "0 Central Release Job" # Adding the 0 so that it's on top of the list of github actions
on:
workflow_dispatch: # Manual trigger so you don't release on every push
inputs:
ref_to_release:
description: "[Optional] Branch or commit to release. Default: Github default branch"
required: false
type: string
# default has to be a static string, no variables allowed
default: ""

jobs:
call-release-job:
permissions:
contents: write # needed to push commit and tag back to the repository
uses: project-ncl/shared-github-actions/.github/workflows/maven-release.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23
with:
java_version: "11"
ref_to_release: ${{ inputs.ref_to_release }}
release_command: 'mvn -B -V release:prepare release:perform -DlocalCheckout=true -DpushChanges=false'
secrets:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_BOT_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_BOT_TOKEN }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
25 changes: 25 additions & 0 deletions .github/workflows/maven-set-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "0 Maven Set Version Job" # Adding the 0 so that it's on top of the list of github actions
on:
workflow_dispatch: # Manual trigger
inputs:
new_version:
description: "[Required] Version to set"
required: true
type: string

ref_for_version:
description: "[Optional] Branch or commit to change version. Default: Github default branch"
required: false
type: string
# default has to be a static string, no variables allowed
default: ""

jobs:
call-maven-set-version-job:
permissions:
contents: write # needed to push commit and tag back to the repository
uses: project-ncl/shared-github-actions/.github/workflows/maven-set-version.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23
with:
java_version: "11"
new_version: ${{ inputs.new_version }}
ref_for_version: ${{ inputs.ref_for_version }}
18 changes: 18 additions & 0 deletions .github/workflows/maven-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build snapshot version and upload to Maven Central

on:
push:
branches: ["master"]

permissions: {}

jobs:
call-snapshot-job:
uses: project-ncl/shared-github-actions/.github/workflows/maven-snapshot.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23
with:
java_version: "11"
project_name: "Commonjava/commonjava"
snapshot_deploy_command: "mvn help:effective-settings -B -V clean deploy -e"
secrets:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_BOT_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_BOT_TOKEN }}
11 changes: 11 additions & 0 deletions .github/workflows/validate-gh-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Validate GitHub Actions Workflows
permissions: {}

on:
pull_request:
paths:
- ".github/workflows/*.yml"

jobs:
validate:
uses: project-ncl/shared-github-actions/.github/workflows/validate-gh-action.yml@646d9b629925d6405fb06ed1476aefd6b2cdca86 # v0.0.23
4 changes: 2 additions & 2 deletions codestyles/CommonJava.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!--

Copyright (C) 2011-2022 Red Hat, Inc. (http://github.com/Commonjava/commonjava)
Copyright © 2011-2022 Red Hat, Inc. (http://github.com/Commonjava/commonjava)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
4 changes: 2 additions & 2 deletions pmd-ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0"?>
<!--

Copyright (C) 2011-2022 Red Hat, Inc. (http://github.com/Commonjava/commonjava)
Copyright © 2011-2022 Red Hat, Inc. (http://github.com/Commonjava/commonjava)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
24 changes: 14 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!--

Copyright (C) 2011-2022 Red Hat, Inc. (http://github.com/Commonjava/commonjava)
Copyright © 2011-2022 Red Hat, Inc. (http://github.com/Commonjava/commonjava)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -93,6 +93,11 @@
<enforceStandards>true</enforceStandards>
<enforceVersions>true</enforceVersions>
<enforceTripHazards>true</enforceTripHazards>

<central.sonatype.url>https://central.sonatype.com/repository/maven-snapshots/</central.sonatype.url>
<central.serverId>central-publisher</central.serverId>
<central.autoPublish>true</central.autoPublish>
<central.skipPublishing>false</central.skipPublishing>
</properties>

<build>
Expand Down Expand Up @@ -181,7 +186,7 @@
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>release</releaseProfiles>
<releaseProfiles>central-release</releaseProfiles>
</configuration>
</plugin>
<plugin>
Expand All @@ -190,8 +195,9 @@
<version>${version.plugin.sonatype}</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<publishingServerId>${central.serverId}</publishingServerId>
<autoPublish>${central.autoPublish}</autoPublish>
<skipPublishing>${central.skipPublishing}</skipPublishing>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -457,7 +463,7 @@
</build>
</profile>
<profile>
<id>release</id>
<id>central-release</id>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -510,9 +516,8 @@
<distributionManagement>
<snapshotRepository>
<uniqueVersion>true</uniqueVersion>
<id>central-portal-snapshots</id>
<name>Central Portal Snapshots</name>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<id>${central.serverId}</id>
<url>${central.sonatype.url}</url>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>
Expand All @@ -525,5 +530,4 @@
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>

</project>
Loading