OpenSC/OpenSC-Java

pkcs11 fails to build with maven

uberspot opened this issue · 5 comments

This is the mvn package output. Below are the java and maven versions. Any suggestions? pkcs15 builds fine. :)

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project opensc-PKCS11: Compilation failure: Compilation failure:
[ERROR] OpenSC-Java/pkcs11/java/src/org/opensc/pkcs11/wrap/PKCS11Certificate.java:[40,25] cannot find symbol
[ERROR] symbol:   class BigInt
[ERROR] location: package sun.security.util
[ERROR] OpenSC-Java/pkcs11/java/src/org/opensc/pkcs11/wrap/PKCS11Certificate.java:[55,17] cannot find symbol
[ERROR] symbol:   class BigInt
[ERROR] location: class org.opensc.pkcs11.wrap.PKCS11Certificate
[ERROR] OpenSC-Java/pkcs11/java/src/org/opensc/pkcs11/wrap/PKCS11Certificate.java:[179,16] cannot find symbol
[ERROR] symbol:   class BigInt
[ERROR] location: class org.opensc.pkcs11.wrap.PKCS11Certificate
[ERROR] OpenSC-Java/pkcs11/java/src/org/opensc/pkcs11/wrap/PKCS11Certificate.java:[75,35] cannot find symbol
[ERROR] symbol:   class BigInt
[ERROR] location: class org.opensc.pkcs11.wrap.PKCS11Certificate
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project opensc-PKCS11: Compilation failure
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
    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:497)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 20 more
[ERROR] 

$ java -version  
openjdk version "1.8.0_45"
OpenJDK Runtime Environment (build 1.8.0_45-b14)
OpenJDK 64-Bit Server VM (build 25.45-b02, mixed mode)

 mvn -v 
 Apache Maven 3.3.3 (NON-CANONICAL_2015-04-29T11:04:34_root;  2015-04-29T08:04:34+00:00)
 Maven home: /opt/maven
 Java version: 1.8.0_45, vendor: Oracle Corporation
 Java home: /usr/lib/jvm/java-8-openjdk/jre 
 Default locale: en_US, platform encoding: UTF-8
 OS name: "linux", version: "4.0.1-1-arch", arch: "amd64", family: "unix"

Also a general question. Is this importable to eclipse? It seems to fail to build by default. What else is necessary for it to build there as well?

This was fixed ^ when I switched to openjdk7 instead of 8. Seems the BigInt sun library was discontinued in the latter.

I guess this needs to be re-factored to java.math.BigInteger.

Unfortunately there is currently no maintainer for the version in this repository. We maintain an internal version that we use with the Smart Card Shell, but that uses ant+ivy instead of maven.

We are in the process of migrating that repo from the internal svn to our Github space.

The PKCS#15 part is fully unmaintained (and largely incomplete)

Ok then, i'll await for the internal version migration then. :)

The PKCS11 code is now available at

https://github.com/CardContact/opensc-java

Sweet, closing the issue then :)