Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mvn flyway:migrate时报这个错误是什么原因啊? #6

Open
zx-cyber opened this issue Feb 14, 2020 · 4 comments
Open

mvn flyway:migrate时报这个错误是什么原因啊? #6

zx-cyber opened this issue Feb 14, 2020 · 4 comments

Comments

@zx-cyber
Copy link

[WARNING] Error injecting: org.flywaydb.maven.MigrateMojo
java.lang.TypeNotPresentException: Type org.flywaydb.maven.MigrateMojo 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:85)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter
.java:57)
at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:66)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.jav
a:112)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.jav
a:127)
at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66)
at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:61)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:
47)
at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1050)
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:520)

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:124)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
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.jav

a:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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: org/flywaydb/maven/MigrateMojo : Unsupported major.minor version 52.0

at java.lang.ClassLoader.defineClass1 (Native Method)
at java.lang.ClassLoader.defineClass (ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass (URLClassLoader.java:449)
at java.net.URLClassLoader.access$100 (URLClassLoader.java:71)
at java.net.URLClassLoader$1.run (URLClassLoader.java:361)
at java.net.URLClassLoader$1.run (URLClassLoader.java:355)
at java.security.AccessController.doPrivileged (Native Method)
at java.net.URLClassLoader.findClass (URLClassLoader.java:354)
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)
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:85)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter

.java:57)
at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:66)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.jav
a:112)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.jav
a:127)
at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66)
at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:61)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:
47)
at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1050)
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:520)

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:124)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
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.jav

a:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.553 s
[INFO] Finished at: 2020-02-14T20:16:11+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:5.2.4:migrate (default-cli) on project community: Execut
ion default-cli of goal org.flywaydb:flyway-maven-plugin:5.2.4:migrate failed: Unable to load the mojo 'migrate' in the
plugin 'org.flywaydb:flyway-maven-plugin:5.2.4' due to an API incompatibility: org.codehaus.plexus.component.repository.
exception.ComponentLookupException: org/flywaydb/maven/MigrateMojo : Unsupported major.minor version 52.0
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.flywaydb:flyway-maven-plugin:5.2.4
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/E:/program/apache-maven-3.6.0-bin/Repository/org/flywaydb/flyway-maven-plugin/5.2.4/flyway-maven
-plugin-5.2.4.jar
[ERROR] urls[1] = file:/E:/program/apache-maven-3.6.0-bin/Repository/mysql/mysql-connector-java/5.1.45/mysql-connector-j
ava-5.1.45.jar
[ERROR] urls[2] = file:/E:/program/apache-maven-3.6.0-bin/Repository/com/h2database/h2/1.4.199/h2-1.4.199.jar
[ERROR] urls[3] = file:/E:/program/apache-maven-3.6.0-bin/Repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-injec
t-bean-1.4.2.jar
[ERROR] urls[4] = file:/E:/program/apache-maven-3.6.0-bin/Repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7
-noaop.jar
[ERROR] urls[5] = file:/E:/program/apache-maven-3.6.0-bin/Repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7
.jar
[ERROR] urls[6] = file:/E:/program/apache-maven-3.6.0-bin/Repository/org/codehaus/plexus/plexus-interpolation/1.14/plexu
s-interpolation-1.14.jar
[ERROR] urls[7] = file:/E:/program/apache-maven-3.6.0-bin/Repository/org/codehaus/plexus/plexus-component-annotations/1.
5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[8] = file:/E:/program/apache-maven-3.6.0-bin/Repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexu
s-sec-dispatcher-1.4.jar
[ERROR] urls[9] = file:/E:/program/apache-maven-3.6.0-bin/Repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher
-1.4.jar
[ERROR] urls[10] = file:/E:/program/apache-maven-3.6.0-bin/Repository/org/codehaus/plexus/plexus-utils/1.5.15/plexus-uti
ls-1.5.15.jar
[ERROR] urls[11] = file:/E:/program/apache-maven-3.6.0-bin/Repository/org/flywaydb/flyway-core/5.2.4/flyway-core-5.2.4.j
ar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------

@zx-cyber
Copy link
Author

jdk不匹配,我用的是1.7

@codedrinker
Copy link
Owner

Unable to load the mojo 'migrate' in the
plugin 'org.flywaydb:flyway-maven-plugin:5.2.4' due to an API incompatibility: org.codehaus.plexus.component.repository.
exception.ComponentLookupException: org/flywaydb/maven/MigrateMojo : Unsupported major.minor version 52.0

@codedrinker
Copy link
Owner

错误提示比较明显,是版本不兼容,建议切换一下版本

@MyTestcube
Copy link

那安装哪个版本就行呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants