Skip to content

Reproducible Builds not working when using modular jar #164

Closed
@jorsol

Description

@jorsol

I have a project that compiles a module-info.java using the <multiReleaseOutput> approach of maven-compiler-plugin as show here:

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
          <executions>
            <execution>
              <id>compile-java9</id>
              <phase>compile</phase>
              <goals>
                <goal>compile</goal>
              </goals>
              <configuration>
                <fork>true</fork>
                <release>9</release>
                <compileSourceRoots>
                  <compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
                </compileSourceRoots>
                <multiReleaseOutput>true</multiReleaseOutput>
              </configuration>
            </execution>
          </executions>
        </plugin>

The <project.build.outputTimestamp> property is set on the project and the jar is created correctly, all the files set the timestamp except for the /META-INF/versions/9/module-info.class file which causes that the build is no longer reproducible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions