0
從本地maven(2.0.8)生成的jar文件與從企業中央版本(maven 2.0.8)生成的jar文件不同。所有的源代碼和pom文件都是相同的,以及存儲庫鏈接。但是,當我跑了利用中央構建罐子工作,這裏是錯誤消息:jar文件不同於不同的maven(相同版本)?
Exception in thread "main" java.lang.ExceptionInInitializerError
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918)
at java.lang.reflect.Field.getFieldAccessor(Field.java:899)
at java.lang.reflect.Field.get(Field.java:358)
at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:770)
(deleted....)
... 15 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:501)
... 17 more
Caused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled schema: Incompatible minor version - expecting up to 23, got 24 (schemaorg_apache_xmlbeans.system.s4260D8D66C8BD97BA7A1A374DB7D9EB0.index) - code 3
at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.<init>(SchemaTypeSystemImpl.java:1522)
at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(SchemaTypeSystemImpl.java:260)
at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.<init>(SchemaTypeSystemImpl.java:183)
... 21 more
但作業成功運行使用從我的本地Maven生成的jar文件。
你可以給我任何建議,我應該看看爲了解決這個問題?
謝謝。這是java編譯器版本差異的問題。但是,我使用maven-compiler-plugin,並將源和目標指定爲1.5。但在中央構建機器上,JAVA_HOME指向java6。我應該如何更改maven的設置,以便當JAVA_HOME指向java 6時maven將使用java 5.謝謝。 – user1454721
可以看看執行插件可能有幫助... – khmarbaise