kie-maven-plugin fails compile If ClassA(in a.jar) which extends ClassB(in b.jar) is used in bpmn2(in c.jar), and dependency for b.jar is not written in c.jar's pom.xml

Solution Verified - Updated -

Issue

In the following situation, maven plugin fails compile:
- There are 2 projects project-a(kie-jar) and project-b(jar)
- project-b depends on spring component
- project-b has a wrapper class, sample.project_b.SpringUtil, which extends a Spring components(org.springframework.context.ApplicationContextAware).
- project-a depends on project-b
- simple-process.bpmn2 in project-a uses sample.project_b.SpringUtil

Error stack trace:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.kie:kie-maven-plugin:6.0.2-redhat-6:build (default-build) on project project-a: Execution default-build of goal org.kie:kie-maven-plugin:6.0.2-redhat-6:build failed: A required class was missing while executing org.kie:kie-maven-plugin:6.0.2-redhat-6:build: org/springframework/context/ApplicationContextAware
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
    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:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
    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: org.apache.maven.plugin.PluginExecutionException: Execution default-build of goal org.kie:kie-maven-plugin:6.0.2-redhat-6:build failed: A required class was missing while executing org.kie:kie-maven-plugin:6.0.2-redhat-6:build: org/springframework/context/ApplicationContextAware
    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: org.apache.maven.plugin.PluginContainerException: A required class was missing while executing org.kie:kie-maven-plugin:6.0.2-redhat-6:build: org/springframework/context/ApplicationContextAware
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:130)
    ... 20 more
Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextAware
    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 java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
    at org.drools.core.common.ProjectClassLoader.internalLoadClass(ProjectClassLoader.java:142)
    at org.drools.core.common.ProjectClassLoader.loadClass(ProjectClassLoader.java:125)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at org.drools.core.base.ClassTypeResolver.resolveType(ClassTypeResolver.java:155)
    at org.drools.compiler.rule.builder.dialect.mvel.MVELDialect.addImport(MVELDialect.java:394)
    at org.drools.compiler.compiler.DialectCompiletimeRegistry.addImport(DialectCompiletimeRegistry.java:87)
    at org.drools.compiler.compiler.PackageRegistry.addImport(PackageRegistry.java:93)
    at org.drools.compiler.compiler.PackageBuilder.mergePackage(PackageBuilder.java:1567)
    at org.drools.compiler.compiler.PackageBuilder.addPackage(PackageBuilder.java:962)
    at org.drools.compiler.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:455)
    at org.jbpm.compiler.ProcessBuilderImpl.buildProcess(ProcessBuilderImpl.java:139)
    at org.jbpm.compiler.ProcessBuilderImpl.addProcessFromXml(ProcessBuilderImpl.java:281)
    at org.drools.compiler.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:699)
    at org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.buildResources(CompositeKnowledgeBuilderImpl.java:149)
    at org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:86)
    at org.drools.compiler.kie.builder.impl.AbstractKieModule.buildKnowledgePackages(AbstractKieModule.java:219)
    at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:39)
    at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:33)
    at org.kie.maven.plugin.BuildMojo.execute(BuildMojo.java:92)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
    ... 20 more
Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContextAware
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    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 java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 52 more

Environment

  • Red Hat JBoss BPM Suite
  • Red Hat JBoss BRMS
    • 6.0.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In