diff --git a/.devcontainer/install_maven.sh b/.devcontainer/install_maven.sh index 6bc43e9..409d8f4 100755 --- a/.devcontainer/install_maven.sh +++ b/.devcontainer/install_maven.sh @@ -5,16 +5,20 @@ echo -x JDK_VERSION="18.0.2.1" JDK_INSTALLER="/tmp/openjdk.tar.gz" -MVN_VERSION="3.9.0" +MVN_VERSION="3.9.4" MVN_INSTALLER="/tmp/mvn.tar.gz" wget https://download.java.net/java/GA/jdk${JDK_VERSION}/db379da656dc47308e138f21b33976fa/1/GPL/openjdk-${JDK_VERSION}_linux-x64_bin.tar.gz -O ${JDK_INSTALLER} -tar -xC /usr/local/sbin -vf ${JDK_INSTALLER} +sudo tar -xC /usr/local/sbin -vf ${JDK_INSTALLER} -ln -s /usr/local/sbin/jdk-${JDK_VERSION}/bin/java /usr/local/sbin/java -ln -s /usr/local/sbin/jdk-${JDK_VERSION}/bin/javac /usr/local/sbin/javac +sudo rm /usr/local/sbin/java +sudo ln -s /usr/local/sbin/jdk-${JDK_VERSION}/bin/java /usr/local/sbin/java + +sudo rm /usr/local/sbin/javac +sudo ln -s /usr/local/sbin/jdk-${JDK_VERSION}/bin/javac /usr/local/sbin/javac wget https://dlcdn.apache.org/maven/maven-3/${MVN_VERSION}/binaries/apache-maven-${MVN_VERSION}-bin.tar.gz -O ${MVN_INSTALLER} tar -xC /usr/local/sbin -vf ${MVN_INSTALLER} -ln -s /usr/local/sbin/apache-maven-${MVN_VERSION}/bin/mvn /usr/local/sbin/mvn \ No newline at end of file +sudo rm /usr/local/sbin/mvn +sudo ln -s /usr/local/sbin/apache-maven-${MVN_VERSION}/bin/mvn /usr/local/sbin/mvn \ No newline at end of file diff --git a/.github/workflows/test_local_action.yml b/.github/workflows/test_local_action.yml index 97cbf72..969f969 100644 --- a/.github/workflows/test_local_action.yml +++ b/.github/workflows/test_local_action.yml @@ -21,4 +21,19 @@ jobs: - name: Run local Action uses: ./ with: - directory: ${{ inputs.directory }} \ No newline at end of file + directory: ${{ inputs.directory }} + + test_with_arguments: + name: Test + + runs-on: ubuntu-22.04 + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Run local Action + uses: ./ + with: + directory: ${{ inputs.directory }} + maven-args: ' -X -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' \ No newline at end of file diff --git a/src/maven-runner.test.ts b/src/maven-runner.test.ts index b026fd9..26f30f1 100644 --- a/src/maven-runner.test.ts +++ b/src/maven-runner.test.ts @@ -85,6 +85,17 @@ describe('maven-runner', () => { // by running with quiet mode there should be no output expect(results.stdout.length).toBe(0); }); + + it('should run path provided maven with additional arguments', async () => { + const projectDir = getMavenProjectDirectory('simple'); + const additionalMavenArgs = ' -X -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'; + const runner = new MavenRunner(projectDir, undefined, false, additionalMavenArgs); + + const results = await runner.exec(projectDir, ['validate']); + expect(results.exitCode).toBe(0); + // by running with quiet mode there should be no output + expect(results.stdout.length).toBe(0); + }); }); describe('with settings', () => {