Maven 构建无法检测 类

Maven build fails to instrument classes

我在 运行 Maven 构建时收到以下错误。似乎无法检测类。任何人都知道应该是什么原因? 谢谢。 这是构建输出:

[ERROR] Failed to execute goal org.javalite:activejdbc-instrumentation:1.4.11:instrument (default) on project xtm2rest: Failed to add output directory to classpath: org.javalite.instrumentation.InstrumentationException: javassist.NotFoundException: modelClass(..) is not found in org.javalite.activejdbc.Model -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.javalite:activejdbc-instrumentation:1.4.11:instrument (default) on project xtm2rest: Failed to add output directory to classpath
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
    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:120)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    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.MojoExecutionException: Failed to add output directory to classpath
    at org.javalite.instrumentation.ActiveJdbcInstrumentationPlugin.execute(ActiveJdbcInstrumentationPlugin.java:88)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: java.lang.RuntimeException: org.javalite.instrumentation.InstrumentationException: javassist.NotFoundException: modelClass(..) is not found in org.javalite.activejdbc.Model
    at org.javalite.instrumentation.Instrumentation.instrument(Instrumentation.java:70)
    at org.javalite.instrumentation.ActiveJdbcInstrumentationPlugin.instrument(ActiveJdbcInstrumentationPlugin.java:124)
    at org.javalite.instrumentation.ActiveJdbcInstrumentationPlugin.execute(ActiveJdbcInstrumentationPlugin.java:82)
    ... 21 more
Caused by: org.javalite.instrumentation.InstrumentationException: javassist.NotFoundException: modelClass(..) is not found in org.javalite.activejdbc.Model
    at org.javalite.instrumentation.ModelInstrumentation.instrument(ModelInstrumentation.java:43)
    at org.javalite.instrumentation.Instrumentation.instrument(Instrumentation.java:57)
    ... 23 more
Caused by: javassist.NotFoundException: modelClass(..) is not found in org.javalite.activejdbc.Model
    at javassist.CtClassType.getDeclaredMethod(CtClassType.java:1210)
    at org.javalite.instrumentation.ModelInstrumentation.doInstrument(ModelInstrumentation.java:51)
    at org.javalite.instrumentation.ModelInstrumentation.instrument(ModelInstrumentation.java:40)
    ... 24 more

由于您没有添加更多信息,我只能推测您的 activejdbc-instrumentation 插件版本与 activejdbc 不同。检查两者是否在同一版本上。