Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: revert maven-plugin-api to 3.6.3 #3745

Closed
wants to merge 4 commits into from
Closed
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
57 changes: 57 additions & 0 deletions .github/workflows/pre-submit.e2e.maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright 2023 SLSA 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.

name: pre-submit e2e maven

on:
# builder_maven_slsa3.yml relies on .github/actions/verify-token, which does not support merge_group and pull_request events.
push:
workflow_dispatch:

permissions: read-all

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build:
permissions:
id-token: write # For signing.
contents: read # For repo checkout of private repos.
actions: read # For getting workflow run on private repos.
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_maven_slsa3.yml@main
with:
directory: ./e2e/maven/workflow_dispatch

verify:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: slsa-framework/slsa-github-generator/actions/maven/secure-download-attestations@main
with:
name: "${{ needs.build.outputs.provenance-download-name }}"
sha256: "${{ needs.build.outputs.provenance-download-sha256 }}"
path: ./
- uses: slsa-framework/slsa-github-generator/actions/maven/secure-download-target@main
with:
name: "${{ needs.build.outputs.target-download-name }}"
sha256: "${{ needs.build.outputs.target-download-sha256 }}"
path: ./
- uses: slsa-framework/slsa-verifier/actions/[email protected]
- name: Verify artifact
env:
PROVENANCE_PATH: ${{ needs.build.outputs.provenance-download-name }}
TARGET_PATH: ${{ needs.build.outputs.target-download-name }}
run: slsa-verifier verify-artifact "$TARGET_PATH" --provenance-path "$PROVENANCE_PATH"
10 changes: 10 additions & 0 deletions actions/maven/publish/slsa-hashing-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
<maven.compiler.source>1.8</maven.compiler.source>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.13.1</version>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
Expand Down
3 changes: 3 additions & 0 deletions e2e/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# E2E Tests

This folder contains test data for some end-to-end (E2E) tests.
168 changes: 168 additions & 0 deletions e2e/maven/workflow_dispatch/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.adamkorcz</groupId>
<artifactId>test-java-project</artifactId>
<version>1.21.96</version>
<packaging>jar</packaging>
<name>Adams test java project</name>
<description>A test java project.</description>
<url>https://github.com/AdamKorcz/test-java-project</url>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
</license>
</licenses>
<developers>
<developer>
<name>Adam K</name>
<email>[email protected]</email>
<organization>Ada Logics</organization>
<organizationUrl>http://www.adalogics.com</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/adamkorcz/test-java-project.git</connection>
<developerConnection>scm:git:ssh://github.com:simpligility/test-java-project.git</developerConnection>
<url>http://github.com/adamkorcz/test-java-project/tree/main</url>
</scm>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.13.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>
<configuration>
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>hello.HelloWorld</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<gpgArguments>
<argument>--pinentry-mode</argument>
<argument>loopback</argument>
</gpgArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.2</version>
<executions>
<execution>
<id>deploy-file</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<file>textfile.txt</file>
<url>https://s01.oss.sonatype.org/</url>
<repositoryId>io.github.adamkorcz</repositoryId>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.github.slsa-framework.slsa-github-generator</groupId>
<artifactId>hash-maven-plugin</artifactId>
<version>0.0.1</version>
<executions>
<execution>
<goals>
<goal>hash-jarfile</goal>
</goals>
</execution>
</executions>
<configuration>
<outputJsonPath>${SLSA_OUTPUTS_ARTIFACTS_FILE}</outputJsonPath>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package hello;

public class Greeter {
public String sayHello() {
return "Hello world!";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package hello;

public class HelloWorld {
public static void main(String[] args) {
Greeter greeter = new Greeter();
System.out.println(greeter.sayHello());
}
}
Loading