Skip to content
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
20 changes: 20 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
<maven-javadoc-plugin.version>3.0.0-M1</maven-javadoc-plugin.version>
<maven-resources-plugin.version>3.0.2</maven-resources-plugin.version>
<maven-shade-plugin.version>3.0.0</maven-shade-plugin.version>
<reproducible-build-maven-plugin.version>0.3</reproducible-build-maven-plugin.version>

<compiler.error.flag>-Werror</compiler.error.flag>
<compiler.default.pkginfo.flag>-Xpkginfo:always</compiler.default.pkginfo.flag>
Expand Down Expand Up @@ -271,6 +272,11 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>

<plugin>
<groupId>io.github.zlika</groupId>
<artifactId>reproducible-build-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
Expand Down Expand Up @@ -1410,6 +1416,7 @@
<doctitle>Apache Beam SDK for Java, version ${project.version}</doctitle>
<use>false</use>
<quiet>true</quiet>
<notimestamp>true</notimestamp>
</configuration>
</plugin>

Expand Down Expand Up @@ -1772,6 +1779,19 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>io.github.zlika</groupId>
<artifactId>reproducible-build-maven-plugin</artifactId>
<version>${reproducible-build-maven-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>strip-jar</goal>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you describe the differences to the jar? I tried a little of this a while ago and was not sure about what was OK to remove.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well the thing is that java adds timestamps in some of the jar elements, e.g. the MANIFEST file and in some cases in the files that are updated with last modification date. The plugin covers these and other cases, you can take a look at the presentation he did (is really short) for some more detail. https://zlika.github.io/presentations/devoxx_fr_2016/reproducible-builds/slides_en.html#/_pom_properties

</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@
import org.apache.commons.io.FileUtils;
import org.apache.hadoop.conf.Configuration;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

/**
* Test for dependency resolution for pipeline execution on YARN.
*/
public class ApexYarnLauncherTest {
@Rule public TemporaryFolder tmpFolder = new TemporaryFolder();

@Test
public void testGetYarnDeployDependencies() throws Exception {
Expand Down Expand Up @@ -119,10 +122,9 @@ public void shutdown(org.apache.apex.api.Launcher.ShutdownMode arg0) {

@Test
public void testCreateJar() throws Exception {
File baseDir = new File("./target/testCreateJar");
File srcDir = new File(baseDir, "src");
File baseDir = tmpFolder.newFolder("target", "testCreateJar");
File srcDir = tmpFolder.newFolder("target", "testCreateJar", "src");
String file1 = "file1";
FileUtils.forceMkdir(srcDir);
FileUtils.write(new File(srcDir, file1), "file1");

File jarFile = new File(baseDir, "test.jar");
Expand All @@ -134,6 +136,5 @@ public void testCreateJar() throws Exception {
Assert.assertTrue("manifest", Files.isRegularFile(zipfs.getPath(JarFile.MANIFEST_NAME)));
Assert.assertTrue("file1", Files.isRegularFile(zipfs.getPath(file1)));
}

}
}