Skip to content

Fix maven build errors #2

@ARF1

Description

@ARF1

Running mvn package results in build errors due to tests being configured but the test-files being missing. As a result, the tests fail and the package fails to build:

$ cd app/libs/pdfparse

$ mvn package

[INFO] Scanning for projects...

[INFO] ------------------------------------------------------------------------

[INFO] Reactor Build Order:

[INFO] 

[INFO] PDFParse-lib

[INFO] PDFParse examples

[INFO] PDFParse

[INFO] 

[INFO] ------------------------------------------------------------------------

[INFO] Building PDFParse-lib 1.0

[INFO] ------------------------------------------------------------------------

Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom

Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom (5.8 kB at 13 kB/s)

Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom

Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom (13 kB at 326 kB/s)

Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.jar

Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.jar (34 kB at 756 kB/s)

Downloading: http://repo.maven.apache.org/maven2/junit/junit/4.11/junit-4.11.pom

Downloaded: http://repo.maven.apache.org/maven2/junit/junit/4.11/junit-4.11.pom (2.3 kB at 63 kB/s)

Downloading: http://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom

Downloaded: http://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom (766 B at 29 kB/s)

Downloading: http://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom

Downloaded: http://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom (2.0 kB at 79 kB/s)

Downloading: http://repo.maven.apache.org/maven2/junit/junit/4.11/junit-4.11.jar

Downloading: http://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar

Downloaded: http://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar (45 kB at 776 kB/s)

Downloaded: http://repo.maven.apache.org/maven2/junit/junit/4.11/junit-4.11.jar (245 kB at 2.8 MB/s)

[INFO] 

[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ pdfparse-lib ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory /home/travis/build/ARF1/ZotDroid/app/libs/pdfparse/pdfparse-lib/src/main/resources

[INFO] 

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ pdfparse-lib ---

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 34 source files to /home/travis/build/ARF1/ZotDroid/app/libs/pdfparse/pdfparse-lib/target/classes

[WARNING] /home/travis/build/ARF1/ZotDroid/app/libs/pdfparse/pdfparse-lib/src/main/java/org/pdfparse/utils/IntObjHashtable.java: /home/travis/build/ARF1/ZotDroid/app/libs/pdfparse/pdfparse-lib/src/main/java/org/pdfparse/utils/IntObjHashtable.java uses unchecked or unsafe operations.

[WARNING] /home/travis/build/ARF1/ZotDroid/app/libs/pdfparse/pdfparse-lib/src/main/java/org/pdfparse/utils/IntObjHashtable.java: Recompile with -Xlint:unchecked for details.

[INFO] 

[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ pdfparse-lib ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 7 resources

[INFO] 

[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ pdfparse-lib ---

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 5 source files to /home/travis/build/ARF1/ZotDroid/app/libs/pdfparse/pdfparse-lib/target/test-classes

[INFO] 

[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ pdfparse-lib ---

[INFO] Surefire report directory: /home/travis/build/ARF1/ZotDroid/app/libs/pdfparse/pdfparse-lib/target/surefire-reports

-------------------------------------------------------

 T E S T S

-------------------------------------------------------

Running org.pdfparse.TestCOSNumber

Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.078 sec

Running org.pdfparse.FileHandlingTest

---- Parsing file: noise.pdf ... Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.027 sec <<< FAILURE!

checkEvilPDFs(org.pdfparse.FileHandlingTest)  Time elapsed: 0.016 sec  <<< ERROR!

java.io.FileNotFoundException: /home/travis/build/ARF1/ZotDroid/app/libs/pdfparse/pdfparse-lib/target/test-classes/malformed_pdfs\noise.pdf (No such file or directory)

	at java.io.FileInputStream.open0(Native Method)

	at java.io.FileInputStream.open(FileInputStream.java:195)

	at java.io.FileInputStream.<init>(FileInputStream.java:138)

	at org.pdfparse.model.PDFDocument.open(PDFDocument.java:88)

	at org.pdfparse.model.PDFDocument.<init>(PDFDocument.java:67)

	at org.pdfparse.FileHandlingTest.checkEvilPDFs(FileHandlingTest.java:51)

	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

	at java.lang.reflect.Method.invoke(Method.java:498)

	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)

	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)

	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)

	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)

	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)

	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)

	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)

	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)

	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)

	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)

	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)

	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)

	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)

	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

	at java.lang.reflect.Method.invoke(Method.java:498)

	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)

	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)

	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)

	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)

	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Running org.pdfparse.TestCOSString

Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.039 sec

Running org.pdfparse.ComplexTest

Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.022 sec

Results :

Tests in error: 

  checkEvilPDFs(org.pdfparse.FileHandlingTest): /home/travis/build/ARF1/ZotDroid/app/libs/pdfparse/pdfparse-lib/target/test-classes/malformed_pdfs\noise.pdf (No such file or directory)

Tests run: 16, Failures: 0, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------

[INFO] Reactor Summary:

[INFO] 

[INFO] PDFParse-lib ....................................... FAILURE [  4.511 s]

[INFO] PDFParse examples .................................. SKIPPED

[INFO] PDFParse ........................................... SKIPPED

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 4.700 s

[INFO] Finished at: 2017-12-16T18:32:29Z

[INFO] Final Memory: 21M/266M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project pdfparse-lib: There are test failures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions