Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c5067e8
Initial pass at Maven
ctmay4 Nov 18, 2025
fc380fd
Change JDK distro
ctmay4 Nov 18, 2025
5e96c78
Sonarcloud config
ctmay4 Nov 18, 2025
6bb3c79
Set Sonar plugin version
ctmay4 Nov 18, 2025
ce4fd9c
Try to fix caching
ctmay4 Nov 18, 2025
c8a1163
Caching working now
ctmay4 Nov 18, 2025
ad8d220
Update Maven wrapper
ctmay4 Nov 18, 2025
201db03
Update Maven wrapper
ctmay4 Nov 18, 2025
4861eaf
Update Maven wrapper
ctmay4 Nov 18, 2025
021f9fe
Fix cache key
ctmay4 Nov 18, 2025
ab716c0
Improved logging
ctmay4 Nov 18, 2025
b0905c5
Add more provider constructors
ctmay4 Nov 18, 2025
41dd39d
Fix Spotbugs
ctmay4 Nov 18, 2025
0e044c7
Plugin updates
ctmay4 Nov 18, 2025
74aee83
Switch to algorithm zip files
ctmay4 Nov 18, 2025
4964dfa
Working on publishing
ctmay4 Nov 18, 2025
ea5cd06
Zip bomb detection
ctmay4 Nov 19, 2025
b813563
Fix Sonarqube issues
ctmay4 Nov 19, 2025
53d0dc7
Zip downloaded algorithms automatically
ctmay4 Nov 19, 2025
964328a
FIx UpdaterUtils
ctmay4 Nov 19, 2025
0f5bdc3
Clean up publishing
ctmay4 Nov 19, 2025
e5535f5
Fix class name
ctmay4 Nov 19, 2025
89bb90c
Try again
ctmay4 Nov 19, 2025
3d93778
Debug
ctmay4 Nov 19, 2025
d31ee9f
Seems to work now
ctmay4 Nov 19, 2025
927711b
Fixed log message typo
ctmay4 Nov 19, 2025
e24a5c5
Oops. Need to switch this.
ctmay4 Nov 19, 2025
e1ab331
We are about ready
ctmay4 Nov 19, 2025
9ad3190
Add new Staging init methods
ctmay4 Nov 19, 2025
69a9385
Cleanup on README
ctmay4 Nov 19, 2025
13caec1
Fixed upload workflow
ctmay4 Nov 20, 2025
0eca27e
Be consistent
ctmay4 Nov 20, 2025
013a772
Optimize release
ctmay4 Nov 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
26 changes: 15 additions & 11 deletions .github/workflows/cs-comparison.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# Run the full CS ingration comparison
#
# This is just a proof of concept for now since the raw input is not available as it
# is too large to include in repository.

name: cs-comparison

on: workflow_dispatch

jobs:
build:

runs-on: ubuntu-latest

steps:
Expand All @@ -19,11 +13,21 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
distribution: 'temurin'
java-version: '21'
cache: 'gradle'
cache: 'maven'

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: CS Comparison
# Run the comparison using the test classpath
- name: Build and run CS Comparison
run: |
chmod +x gradlew
./gradlew :staging-client-java-cs:csIntegrationTest
chmod +x ./mvnw
./mvnw -B test-compile -DskipTests
./mvnw -B exec:java -DskipTests -Dexec.mainClass=com.imsweb.staging.cs.CsIntegrationTest -Dexec.classpathScope=test
19 changes: 14 additions & 5 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,30 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
distribution: 'temurin'
java-version: '21'
cache: 'gradle'
cache: 'maven'

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
restore-keys: |
${{ runner.os }}-sonar

- name: Build and test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
chmod +x gradlew
./gradlew build sonar
chmod +x ./mvnw
./mvnw -B verify sonar:sonar
69 changes: 55 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,76 @@
# Publish to Maven Central
# Publish to Maven Central (Maven)
#
# Non-SNAPSHOT releases are done automatically on Git tag. SNAPSHOT releases are not handled by CI; use
# the following command to release a SNAPSHOT (ensure the version in pom.xml is a SNAPSHOT version):
#
# $ .\mvnw.cmd deploy -DskipTests
#
# Note that to release locally you will need to set up a settings.xml file in you user
# home .m2 directory. The username and password is generated at:
#
# https://central.sonatype.com/usertoken.
#
# Here is the settings.xml file:
#
# <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
# xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
# xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
# https://maven.apache.org/xsd/settings-1.0.0.xsd">
# <servers>
# <server>
# <!-- must match <id>ossrh</id> in distributionManagement -->
# <id>central</id>
# <username>USERNAME FROM GENERATED TOKEN</username>
# <password>PASSWORD FROM GENERATED TOKEN</password>
# </server>
# </servers>
# </settings>

name: publish

on:
repository_dispatch:
types: manual-publish
release:
types: [ created ]
types: [ published ]

jobs:
publish:

runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK
- name: Set up JDK 21 for Maven Central
uses: actions/setup-java@v4
with:
distribution: 'adopt'
distribution: 'temurin'
java-version: '21'
cache: 'gradle'
cache: 'maven'

# Must match <id> in <distributionManagement>
server-id: central

# These are Maven properties in settings.xml; values come from env below
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_PASSWORD

- name: Publish to Maven Central (Portal)
run: |
chmod +x gradlew
./gradlew publishAndReleaseToMavenCentral --no-configuration-cache
# GPG setup (uses your in-memory private key)
gpg-private-key: ${{ secrets.SIGNING_KEY }}

# Name of env var that holds the passphrase (see pom passphraseEnvName)
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish to Maven Central
run: mvn -B -ntp clean deploy -P release -DskipTests -Dspotbugs.skip=true -Djacoco.skip=true
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
# Sonatype / Central credentials
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

# GPG passphrase (referenced by MAVEN_GPG_PASSPHRASE name)
MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSWORD }}
26 changes: 5 additions & 21 deletions .github/workflows/upload-algorithms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,22 @@
name: upload-algorithms

on:
repository_dispatch:
types: manual-publish
release:
types: [ created ]
types: [published]

jobs:
publish:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '21'

- name: Create algorithm zips
if: ${{startsWith(github.ref, 'refs/tags/v') }}
run: |
chmod +x gradlew
./gradlew zipAlgorithms

- name: Add algorithms to release
uses: softprops/action-gh-release@v1
if: ${{startsWith(github.ref, 'refs/tags/v') }}
with:
files: |
algorithm-cs/build/algorithms/*.zip
algorithm-eod/build/algorithms/*.zip
algorithm-tnm/build/algorithms/*.zip
algorithm-pediatric/build/algorithms/*.zip
src/test/resources/algorithms/cs-*.zip
src/test/resources/algorithms/eod_public-*.zip
src/test/resources/algorithms/pediatric-*.zip
src/test/resources/algorithms/tnm-*.zip
40 changes: 32 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
target
build
classes
dist
out
/.idea
HELP.md
target/
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
.dbshell
.gradle
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

117 changes: 117 additions & 0 deletions .mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* Copyright 2007-present the original author or authors.
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;

public class MavenWrapperDownloader {

private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";

/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";

/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";

/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";

public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());

// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);

File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}

private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}

}
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
Loading