Unable to build the core.jar

2,036 views
Skip to first unread message

Accessible Systems

unread,
May 14, 2013, 8:22:13 AM5/14/13
to zx...@googlegroups.com
Hi guys 

It's nice to have new update but i am not able to build the core.jar file when following the instruction from https://code.google.com/p/zxing/wiki/GettingStarted

I encountered following error.... while executing the command to build the core.jar file

Tests run: 334, Failures: 52, Errors: 52, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.857s
[INFO] Finished at: Tue May 14 17:41:33 GMT 2013
[INFO] Final Memory: 12M/170M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.14.1:test (default-test) on project core: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:

Sean Owen

unread,
May 14, 2013, 8:36:42 AM5/14/13
to zx...@googlegroups.com
Did you download the test images? you're not showing the failure itself.
Or, if you don't want to download them, run with -DskipTests

Accessible Systems

unread,
May 14, 2013, 9:23:21 AM5/14/13
to zx...@googlegroups.com
Tryed once again now it is asking for 

GPG Passphrase: *

I don't know what is wrong in my flow....... i compile this time as you suggested 

mvn -DskipTests=true install
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building ZXing Core 2.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-maven) @ core ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 221 source files to /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/build
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 120 source files to /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.14.1:test (default-test) @ core ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ core ---
[INFO] Building jar: /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/core-2.3-SNAPSHOT.jar
[INFO] 
[INFO] >>> maven-source-plugin:2.2.1:jar (attach-sources) @ core >>>
[INFO] 
[INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-maven) @ core ---
[INFO] 
[INFO] <<< maven-source-plugin:2.2.1:jar (attach-sources) @ core <<<
[INFO] 
[INFO] --- maven-source-plugin:2.2.1:jar (attach-sources) @ core ---
[INFO] Building jar: /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/core-2.3-SNAPSHOT-sources.jar
[INFO] 
[INFO] --- maven-javadoc-plugin:2.9:jar (attach-javadocs) @ core ---
[INFO] 
Loading source files for package com.google.zxing...
Loading source files for package com.google.zxing.maxicode.decoder...
Loading source files for package com.google.zxing.maxicode...
.
.
.
.
Loading source files for package com.google.zxing.pdf417.detector...
Constructing Javadoc information...
Standard Doclet version 1.7.0_09-icedtea
Building tree for all the packages and classes...
Generating /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/apidocs/com/google/zxing/BarcodeFormat.html...
Generating /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/apidocs/com/google/zxing/Binarizer.html...
Generating /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/apidocs/com/google/zxing/BinaryBitmap.html...
.
.
.
.
Generating /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/apidocs/com/google/zxing/qrcode/encoder/package-use.html...
Building index for all the packages and classes...
Generating /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/apidocs/overview-tree.html...
Generating /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/apidocs/index-all.html...
Generating /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/apidocs/deprecated-list.html...
Building index for all classes...
Generating /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/apidocs/allclasses-frame.html...
Generating /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/apidocs/allclasses-noframe.html...
Generating /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/apidocs/index.html...
Generating /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/apidocs/overview-summary.html...
Generating /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/apidocs/help-doc.html...
1 warning
[WARNING] Javadoc Warnings
[WARNING] /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/src/com/google/zxing/pdf417/decoder/PDF417ScanningDecoder.java:292: warning - @return tag has no arguments.
[INFO] Building jar: /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/core/target/core-2.3-SNAPSHOT-javadoc.jar
[INFO] 
[INFO] --- maven-dependency-plugin:2.7:copy (copy-android) @ core ---
[INFO] Configured Artifact: com.google.zxing:core:2.2-SNAPSHOT:jar
[INFO] Copying core-2.2-SNAPSHOT.jar to /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/android/libs/core-2.2-20130507.200344-19.jar
[INFO] 
[INFO] --- maven-dependency-plugin:2.7:copy (copy-androidtest) @ core ---
[INFO] Configured Artifact: com.google.zxing:core:2.2-SNAPSHOT:jar
[INFO] Copying core-2.2-SNAPSHOT.jar to /home/tushar/Downloads/Android_Extra_Api/zxing-2.2/androidtest/libs/core-2.2-20130507.200344-19.jar
[INFO] 
[INFO] --- maven-gpg-plugin:1.4:sign (sign-artifacts) @ core ---
GPG Passphrase: *        
gpg: no default secret key: secret key not available
gpg: signing failed: secret key not available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3:00.271s
[INFO] Finished at: Tue May 14 18:44:52 GMT 2013
[INFO] Final Memory: 24M/347M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.4:sign (sign-artifacts) on project core: Exit code: 2 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:

Sean Owen

unread,
May 14, 2013, 9:35:19 AM5/14/13
to zx...@googlegroups.com
You need -Dgpg.skip=true since you can't sign the release. (Well you can sign with your key if you want.)

Why do you need to build this though, usually you just need the compiled artifacts from Maven. 

Accessible Systems

unread,
May 14, 2013, 9:44:28 AM5/14/13
to zx...@googlegroups.com
Got it,
now working
thanks for your help :)



On Tuesday, May 14, 2013 12:22:13 PM UTC, Accessible Systems wrote:

Divya Verma

unread,
Jul 24, 2013, 2:09:22 AM7/24/13
to zx...@googlegroups.com
I am not sure why I did not succeed. I used Zxing 2.2 from this location->  http://code.google.com/p/zxing/downloads/detail?name=ZXing-2.2.zip&can=2&q=
 and mvn built it using the command -> mvn -DskipTests -Dgpg.skip=true install

. I got BUILD_FAILURE. with error [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.7:copy (copy-android) on project core: Unable to find artifact. Failure to find com.google.zxing:core:jar:2.2-SNAPSHOT in https://oss.sonatype.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-nexus-snapshots has elapsed or updates are forced

I then downloaded 2.0 and did the same thing and it worked. I could even use it as external library for CaptureActivity. 

I am not sure why I got this error.  Any clue?
with 

Sean Owen

unread,
Jul 24, 2013, 4:01:01 AM7/24/13
to zx...@googlegroups.com
I think the problem is that the pom in the release referred to 2.2-SNAPSHOT, when it should just refer to "2.2". Just replace that everywhere. Or build from HEAD.

kr...@gmx.net

unread,
Nov 21, 2013, 7:44:19 AM11/21/13
to zx...@googlegroups.com
Hi,

I dont know why but it doesn't work for me.

I changed every 2.2-SNAPSHOT to 2.2

Than I go to the core folder and do mvn -DskipTests -Dgpg.skip=true install

But it always asks for a gpg passphrase. If I just hit Enter I get error:
Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.4:sign <sign-artifact> on project core: Exit code: -1

I need to build my own .jar File because I have to patch zxing with the msi Barcode.

Best reagrds

Sean Owen

unread,
Nov 21, 2013, 7:56:31 AM11/21/13
to zx...@googlegroups.com
Looks right to me, hmm. Try just mvn package and then grab the .jar from target/.

kr...@gmx.net

unread,
Nov 21, 2013, 9:05:33 AM11/21/13
to zx...@googlegroups.com
So do you mean just enter mvn package in the command tool?

If I do so, I get error:
Failed to execute goal or.apache.maven.plugins:maven-surefire-plugin:2.14.1:test <default-test> on project core: There are test failures.

Thank you for your very quick answer.

Best regards

Sean Owen

unread,
Nov 21, 2013, 5:44:11 PM11/21/13
to zx...@googlegroups.com
What are the test failures? just skip them with -DskipTests too. They are something to do with your local setup as they pass in the release and HEAD.
I think something is funny with your local env.
Reply all
Reply to author
Forward
0 new messages