2011-02-02 131 views
1

mvn clean package由於警告而失敗。是否由於this錯誤(雖然固定)?有關如何解決此問題的任何建議。Maven由於java.security API警告而失敗

[loading java/security/KeyPairGenerator.class(java/security:KeyPairGenerator.class)] 
[loading sun/security/jca/GetInstance.class(sun/security/jca:GetInstance.class)] 
[loading sun/security/jca/GetInstance$Instance.class(sun/security/jca:GetInstance$Instance.class)] 
[loading java/security/KeyPairGeneratorSpi.class(java/security:KeyPairGeneratorSpi.class)] 
[loading java/security/spec/AlgorithmParameterSpec.class(java/security/spec:AlgorithmParameterSpec.class)] 
[loading java/security/spec/EncodedKeySpec.class(java/security/spec:EncodedKeySpec.class)] 
[loading java/security/spec/KeySpec.class(java/security/spec:KeySpec.class)] 
/home/user/common/common-lib/src/main/java/com/org/security/CryptoUtil.java:200: warning: sun.security.x509.CertAndKeyGen is Sun proprietary API and may be removed in a future release 
     CertAndKeyGen generator = null; 
     ^

/home/user/common/common-lib/src/main/java/com/org/security/CryptoUtil.java:[203,19] sun.security.x509.CertAndKeyGen is Sun proprietary API and may be removed in a future release 

/home/user/common/common-lib/src/main/java/com/org/security/CryptoUtil.java:[205,3] sun.security.x509.X500Name is Sun proprietary API and may be removed in a future release 
/home/user/common/common-lib/src/main/java/com/org/security/CryptoUtil.java:[205,23] sun.security.x509.X500Name is Sun proprietary API and may be removed in a future release 

could not parse error message: [loading sun/security/util/DerInputStream.class(sun/security/util:DerInputStream.class)] 
[loading sun/security/util/DerValue.class(sun/security/util:DerValue.class)] 
[loading sun/security/x509/RDN.class(sun/security/x509:RDN.class)] 
[loading java/security/cert/X509Extension.class(java/security/cert:X509Extension.class)] 
[loading java/security/cert/Certificate.class(java/security/cert:Certificate.class)] 
[loading java/io/FileDescriptor.class(java/io:FileDescriptor.class)] 
[loading java/security/KeyStore$LoadStoreParameter.class(java/security:KeyStore$LoadStoreParameter.class)] 
[loading java/security/Key.class(java/security:Key.class)] 
[loading java/security/SignatureSpi.class(java/security:SignatureSpi.class)] 
[loading java/nio/ByteBuffer.class(java/nio:ByteBuffer.class)] 
/home/user/common/common-lib/src/main/java/com/org/security/CryptoUtil.java:400: warning: com.sun.org.apache.xerces.internal.impl.dv.util.Base64 is Sun proprietary API and may be removed in a future release 
     out.print(Base64.encode(key.getEncoded())); 
       ^

could not parse error message: [loading java/security/Principal.class(java/security:Principal.class)] 
[loading javax/security/auth/x500/X500Principal.class(javax/security/auth/x500:X500Principal.class)] 
[loading java/io/FileWriter.class(java/io:FileWriter.class)] 
[loading java/io/OutputStreamWriter.class(java/io:OutputStreamWriter.class)] 
/home/user/common/common-lib/src/main/java/com/org/security/CryptoUtil.java:415: warning: com.sun.org.apache.xerces.internal.impl.dv.util.Base64 is Sun proprietary API and may be removed in a future release 
     out.print(Base64.encode(certificate.getEncoded())); 

回答

1

望着在這個問題的錯誤鏈接comments,它看起來像當verbose開啓時發生的問題。你可以檢查你的情況是否屬實,如果是這樣,檢查錯誤是否保持關閉?

+0

是的,我剛剛發現錯誤。關掉冗長,並且工作。謝謝 – zengr 2011-02-02 11:21:54

1

通過在我的項目的pom.xml中提供以下參數解決了問題。

<plugin> 
<groupId>org.apache.maven.plugins</groupId> 
<artifactId>maven-compiler-plugin</artifactId> 
<configuration> 
<compilerArguments> 
<bootclasspath>${java.home}\lib\rt.jar</bootclasspath> 
</compilerArguments> 
</configuration> 
</plugin> 

但仍不清楚爲什麼這項工作?