random-maven / flatten-maven-plugin

Simplify maven project descriptor for artifact deployment
https://random-maven.github.io/flatten-maven-plugin/flatten-mojo.html
Other
9 stars 5 forks source link

Unsupported major.minor version 52.0 #2

Closed tribbloid closed 6 years ago

tribbloid commented 6 years ago

Compiling on the following environment:

$ mvn -V
Apache Maven 3.5.0
Maven home: /usr/share/maven
Java version: 1.8.0_161, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_CA, platform encoding: UTF-8
OS name: "linux", version: "4.13.0-32-generic", arch: "amd64", family: "unix"

will yield the following error:

[WARNING] Error injecting: com.carrotgarden.maven.flatten.FlattenMojo
java.lang.TypeNotPresentException: Type com.carrotgarden.maven.flatten.FlattenMojo not present
    at org.eclipse.sisu.space.URLClassSpace.loadClass(URLClassSpace.java:147)
    at org.eclipse.sisu.space.NamedClass.load(NamedClass.java:46)
    at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
    at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
    at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:65)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
    at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
    at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
    at org.eclipse.sisu.inject.Guice4$1.get(Guice4.java:162)
    at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
    at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:519)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:121)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
    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:309)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    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: java.lang.UnsupportedClassVersionError: com/carrotgarden/maven/flatten/FlattenMojo : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:64)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:401)
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
    at org.eclipse.sisu.space.URLClassSpace.loadClass(URLClassSpace.java:139)
    ... 41 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:36 min
[INFO] Finished at: 2018-02-01T02:26:02Z
[INFO] Final Memory: 190M/6845M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "spark-2.2" could not be activated because it does not exist.
[ERROR] Failed to execute goal com.carrotgarden.maven:flatten-maven-plugin:1.2.20171206225205:flatten (flatten) on project factorie: Execution flatten of goal com.carrotgarden.maven:flatten-maven-plugin:1.2.20171206225205:flatten failed: Unable to load the mojo 'flatten' in the plugin 'com.carrotgarden.maven:flatten-maven-plugin:1.2.20171206225205' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: com/carrotgarden/maven/flatten/FlattenMojo : Unsupported major.minor version 52.0
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>com.carrotgarden.maven:flatten-maven-plugin:1.2.20171206225205
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/rof/.m2/repository/com/carrotgarden/maven/flatten-maven-plugin/1.2.20171206225205/flatten-maven-plugin-1.2.20171206225205.jar
[ERROR] urls[1] = file:/home/rof/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
[ERROR] urls[2] = file:/home/rof/.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
[ERROR] urls[3] = file:/home/rof/.m2/repository/org/codehaus/plexus/plexus-utils/3.1.0/plexus-utils-3.1.0.jar
[ERROR] urls[4] = file:/home/rof/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[5] = file:/home/rof/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[6] = file:/home/rof/.m2/repository/org/apache/maven/maven-builder-support/3.5.2/maven-builder-support-3.5.2.jar
[ERROR] urls[7] = file:/home/rof/.m2/repository/org/apache/maven/resolver/maven-resolver-util/1.1.0/maven-resolver-util-1.1.0.jar
[ERROR] urls[8] = file:/home/rof/.m2/repository/org/apache/maven/shared/maven-shared-utils/3.1.0/maven-shared-utils-3.1.0.jar
[ERROR] urls[9] = file:/home/rof/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.3/org.eclipse.sisu.inject-0.3.3.jar
[ERROR] urls[10] = file:/home/rof/.m2/repository/com/google/inject/guice/4.0/guice-4.0-no_aop.jar
[ERROR] urls[11] = file:/home/rof/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
[ERROR] urls[12] = file:/home/rof/.m2/repository/com/google/guava/guava/20.0/guava-20.0.jar
[ERROR] urls[13] = file:/home/rof/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.7.1/plexus-component-annotations-1.7.1.jar
[ERROR] urls[14] = file:/home/rof/.m2/repository/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar
[ERROR] urls[15] = file:/home/rof/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar
[ERROR] urls[16] = file:/home/rof/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.5/maven-plugin-annotations-3.5.jar
[ERROR] urls[17] = file:/home/rof/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.24/plexus-interpolation-1.24.jar
[ERROR] urls[18] = file:/home/rof/.m2/repository/org/apache/maven/plugins/maven-dependency-plugin/3.0.2/maven-dependency-plugin-3.0.2.jar
[ERROR] urls[19] = file:/home/rof/.m2/repository/org/apache/maven/reporting/maven-reporting-api/3.0/maven-reporting-api-3.0.jar
[ERROR] urls[20] = file:/home/rof/.m2/repository/org/apache/maven/reporting/maven-reporting-impl/2.3/maven-reporting-impl-2.3.jar
[ERROR] urls[21] = file:/home/rof/.m2/repository/org/apache/maven/doxia/doxia-core/1.2/doxia-core-1.2.jar
[ERROR] urls[22] = file:/home/rof/.m2/repository/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar
[ERROR] urls[23] = file:/home/rof/.m2/repository/xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.jar
[ERROR] urls[24] = file:/home/rof/.m2/repository/org/apache/httpcomponents/httpclient/4.0.2/httpclient-4.0.2.jar
[ERROR] urls[25] = file:/home/rof/.m2/repository/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar
[ERROR] urls[26] = file:/home/rof/.m2/repository/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar
[ERROR] urls[27] = file:/home/rof/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar
[ERROR] urls[28] = file:/home/rof/.m2/repository/commons-digester/commons-digester/1.6/commons-digester-1.6.jar
[ERROR] urls[29] = file:/home/rof/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
[ERROR] urls[30] = file:/home/rof/.m2/repository/commons-io/commons-io/2.5/commons-io-2.5.jar
[ERROR] urls[31] = file:/home/rof/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.4/doxia-sink-api-1.4.jar
[ERROR] urls[32] = file:/home/rof/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.4/doxia-logging-api-1.4.jar
[ERROR] urls[33] = file:/home/rof/.m2/repository/org/apache/maven/doxia/doxia-site-renderer/1.4/doxia-site-renderer-1.4.jar
[ERROR] urls[34] = file:/home/rof/.m2/repository/org/apache/maven/doxia/doxia-decoration-model/1.4/doxia-decoration-model-1.4.jar
[ERROR] urls[35] = file:/home/rof/.m2/repository/org/apache/maven/doxia/doxia-module-xhtml/1.4/doxia-module-xhtml-1.4.jar
[ERROR] urls[36] = file:/home/rof/.m2/repository/org/apache/maven/doxia/doxia-module-fml/1.4/doxia-module-fml-1.4.jar
[ERROR] urls[37] = file:/home/rof/.m2/repository/org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.jar
[ERROR] urls[38] = file:/home/rof/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[39] = file:/home/rof/.m2/repository/org/codehaus/plexus/plexus-velocity/1.1.7/plexus-velocity-1.1.7.jar
[ERROR] urls[40] = file:/home/rof/.m2/repository/org/apache/velocity/velocity/1.5/velocity-1.5.jar
[ERROR] urls[41] = file:/home/rof/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar
[ERROR] urls[42] = file:/home/rof/.m2/repository/org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.jar
[ERROR] urls[43] = file:/home/rof/.m2/repository/commons-chain/commons-chain/1.1/commons-chain-1.1.jar
[ERROR] urls[44] = file:/home/rof/.m2/repository/dom4j/dom4j/1.1/dom4j-1.1.jar
[ERROR] urls[45] = file:/home/rof/.m2/repository/sslext/sslext/1.2-0/sslext-1.2-0.jar
[ERROR] urls[46] = file:/home/rof/.m2/repository/org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.jar
[ERROR] urls[47] = file:/home/rof/.m2/repository/antlr/antlr/2.7.2/antlr-2.7.2.jar
[ERROR] urls[48] = file:/home/rof/.m2/repository/org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.jar
[ERROR] urls[49] = file:/home/rof/.m2/repository/org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.jar
[ERROR] urls[50] = file:/home/rof/.m2/repository/org/codehaus/plexus/plexus-archiver/3.4/plexus-archiver-3.4.jar
[ERROR] urls[51] = file:/home/rof/.m2/repository/org/apache/commons/commons-compress/1.11/commons-compress-1.11.jar
[ERROR] urls[52] = file:/home/rof/.m2/repository/org/iq80/snappy/snappy/0.4/snappy-0.4.jar
[ERROR] urls[53] = file:/home/rof/.m2/repository/org/tukaani/xz/1.5/xz-1.5.jar
[ERROR] urls[54] = file:/home/rof/.m2/repository/org/apache/maven/shared/file-management/1.2.1/file-management-1.2.1.jar
[ERROR] urls[55] = file:/home/rof/.m2/repository/org/apache/maven/shared/maven-shared-io/1.1/maven-shared-io-1.1.jar
[ERROR] urls[56] = file:/home/rof/.m2/repository/org/codehaus/plexus/plexus-io/2.4/plexus-io-2.4.jar
[ERROR] urls[57] = file:/home/rof/.m2/repository/org/apache/maven/shared/maven-dependency-analyzer/1.7/maven-dependency-analyzer-1.7.jar
[ERROR] urls[58] = file:/home/rof/.m2/repository/org/ow2/asm/asm/5.0.2/asm-5.0.2.jar
[ERROR] urls[59] = file:/home/rof/.m2/repository/org/apache/maven/shared/maven-dependency-tree/3.0.1/maven-dependency-tree-3.0.1.jar
[ERROR] urls[60] = file:/home/rof/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
[ERROR] urls[61] = file:/home/rof/.m2/repository/org/apache/maven/shared/maven-common-artifact-filters/3.0.1/maven-common-artifact-filters-3.0.1.jar
[ERROR] urls[62] = file:/home/rof/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[63] = file:/home/rof/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[64] = file:/home/rof/.m2/repository/org/apache/maven/shared/maven-artifact-transfer/0.9.1/maven-artifact-transfer-0.9.1.jar
[ERROR] urls[65] = file:/home/rof/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar
[ERROR] urls[66] = file:/home/rof/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] urls[67] = file:/home/rof/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar
[ERROR] urls[68] = file:/home/rof/.m2/repository/org/twdata/maven/mojo-executor/2.3.0/mojo-executor-2.3.0.jar
[ERROR] urls[69] = file:/home/rof/.m2/repository/org/slf4j/slf4j-simple/1.7.22/slf4j-simple-1.7.22.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] 
[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:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

Looks like some JVM version dependent classes are included. Is it possible to cross compile and publish?

Andrei-Pozolotin commented 6 years ago

ok, checking

Andrei-Pozolotin commented 6 years ago
  1. those inputs make no sense, since Java 1.8 == Class 52 https://en.wikipedia.org/wiki/Java_class_file

    ###
    Java version: 1.8.0_161, vendor: Oracle Corporation
    ###
    Caused by: java.lang.UnsupportedClassVersionError: com/carrotgarden/maven/flatten/FlattenMojo : Unsupported major.minor version 52.0
  2. few ways to make sense is to assume

    • there is a maven profile which activates 1.7
    • there is a different install set by M2_HOME
    • there is a different ./mvnw.sh used by build
  3. nonetheless, I switched flattend plugin build to 1.7 https://github.com/random-maven/flatten-maven-plugin/blob/master/pom.xml#L35

  4. please try 1.3.x https://bintray.com/random-maven/maven/flatten-maven-plugin

Andrei-Pozolotin commented 6 years ago

assume resoved