bw6-plugin-maven icon indicating copy to clipboard operation
bw6-plugin-maven copied to clipboard

EAR generated using the maven plugin missing the compiled class files in root folder.

Open shylajasastry opened this issue 4 years ago • 3 comments
trafficstars

Maven Plugin version:

Maven version: 2.8.0

Product : Either of TIBCO ActiveMatrix Businessworks 6 OR TIBCO Businessworks Container edition

Product version: 2.6.2

Component: Either of Maven Eclipse Plugin or Maven build plugin

Steps to reproduce the issue:

  1. Java source being used in the same application
  2. Run maven clean package to create ear
  3. This results in class not found error.

Additional environment details if any: Happens with both BW6 and BWCE

Describe the results you received: Class file not being compiled/bundled in ear in the root folder where application is expecting it

Describe the results you expected: Class file should be included in ear in the root folder.

Additional information you deem important (e.g. issue happens only occasionally): n/a

shylajasastry avatar Nov 01 '21 12:11 shylajasastry

I think I might be having the same problem... when I run mvn install on my local machines it generates compiled files to the package root... but when I run it on my dev environment it doesn't. I'm using the same plugin version, the same maven version and plugins on both machines.

Running it on my local machines: [INFO] --- bw6-maven-plugin:2.8.1:bwmodule (default-bwmodule) @ com.tibco.custom.jms.provider --- [DEBUG] Configuring mojo com.tibco.plugins:bw6-maven-plugin:2.8.1:bwmodule from plugin realm ClassRealm[extension>com.tibco.plugins:bw6-maven-plugin:2.8.1, parent: sun.misc.Launcher$AppClassLoader@70dea4e] [DEBUG] Configuring mojo 'com.tibco.plugins:bw6-maven-plugin:2.8.1:bwmodule' with basic configurator --> [DEBUG] (f) classesDirectory = E:\AI\BW\ws\master\W10602\git\W10602\com.tibco.custom.jms.provider\target\classes [DEBUG] (f) outputDirectory = E:\AI\BW\ws\master\W10602\git\W10602\com.tibco.custom.jms.provider\target [DEBUG] (f) project = MavenProject: com.cgd.aisdc:com.tibco.custom.jms.provider:1.0.0-SNAPSHOT @ E:\AI\BW\ws\master\W10602\git\W10602\com.tibco.custom.jms.provider\pom.xml [DEBUG] (f) projectBasedir = E:\AI\BW\ws\master\W10602\git\W10602\com.tibco.custom.jms.provider [DEBUG] (f) qualifierReplacement = timestamp [DEBUG] (f) session = org.apache.maven.execution.MavenSession@24934262 [DEBUG] -- end configuration -- [INFO] Module Packager Mojo started for Module com.tibco.custom.jms.provider ... [INFO] Updated the Manifest version [INFO] The OSGi verion is 1.0.0.202111021654 for Maven version of 1.0.0.202111021654 [INFO] Removing the externals entries if any. [DEBUG] Bundle Classpath before removing externals is .,lib/activemq-all-5.16.2.jar [DEBUG] Bundle Classpath after removing externals is .,lib/activemq-all-5.16.2.jar [DEBUG] Creating Plugin JAR from name com.tibco.custom.jms.provider [INFO] Created Plugin JAR with name E:\AI\BW\ws\master\W10602\git\W10602\com.tibco.custom.jms.provider\target\com.tibco.custom.jms.provider_1.0.0.202111021654.jar [DEBUG] BinInclude list is [META-INF/, OSGI-INF/customJMSProvider.xml, lib/*.jar, ., bin/] [DEBUG] BinExclude list is [] [INFO] Adding Maven Dependencies to the Plugin JAR file [DEBUG] Adding Maven dependencies to the JAR file [DEBUG] Looking up dependency tree for the current project => MavenProject: com.cgd.aisdc:com.tibco.custom.jms.provider:1.0.0-SNAPSHOT @ E:\AI\BW\ws\master\W10602\git\W10602\com.tibco.custom.jms.provider\pom.xml and the current session => org.apache.maven.execution.MavenSession@24934262 [DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=30790, ConflictMarker.markTime=20526, ConflictMarker.nodeCount=2, ConflictIdSorter.graphTime=6736, ConflictIdSorter.topsortTime=9301, ConflictIdSorter.conflictIdCount=1, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=149779, ConflictResolver.conflictItemCount=1, DefaultDependencyCollector.collectTime=153307, DefaultDependencyCollector.transformTime=230602} [DEBUG] com.cgd.aisdc:com.tibco.custom.jms.provider:bwmodule:1.0.0-SNAPSHOT [DEBUG] tempbw:activemq-all-5.16.2:jar:0.0.0:compile [DEBUG] org.apache.maven.project.DefaultDependencyResolutionResult@a5272be [DEBUG] [tempbw:activemq-all-5.16.2:jar:0.0.0 (compile)] [DEBUG] Adding artifact for dependency => tempbw:activemq-all-5.16.2:jar:0.0.0 (compile). The file for Dependency is => D:\Users\c047408.m2\repository\tempbw\activemq-all-5.16.2\0.0.0\activemq-all-5.16.2-0.0.0.jar [DEBUG] Final Bundle-Classpath is .,lib/activemq-all-5.16.2.jar [INFO] Creating the Plugin JAR file [INFO] Building jar: E:\AI\BW\ws\master\W10602\git\W10602\com.tibco.custom.jms.provider\target\com.tibco.custom.jms.provider_1.0.0.202111021654.jar [DEBUG] adding directory META-INF/ [DEBUG] adding entry META-INF/MANIFEST.MF [DEBUG] adding directory com/ [DEBUG] adding directory com/tibco/ [DEBUG] adding directory com/tibco/custom/ [DEBUG] adding directory com/tibco/custom/jms/ [DEBUG] adding directory com/tibco/custom/jms/provider/ [DEBUG] adding entry com/tibco/custom/jms/provider/Activator.class [DEBUG] adding entry com/tibco/custom/jms/provider/CustomJMSProvider.class [DEBUG] adding directory bin/ [DEBUG] adding directory bin/com/ [DEBUG] adding directory bin/com/tibco/ [DEBUG] adding directory bin/com/tibco/custom/ [DEBUG] adding directory bin/com/tibco/custom/jms/ [DEBUG] adding directory bin/com/tibco/custom/jms/provider/ [DEBUG] adding entry bin/com/tibco/custom/jms/provider/Activator.class [DEBUG] adding entry bin/com/tibco/custom/jms/provider/CustomJMSProvider.class [DEBUG] adding directory lib/ [DEBUG] adding entry lib/activemq-all-5.16.2.jar [DEBUG] adding directory OSGI-INF/ [DEBUG] adding entry OSGI-INF/customJMSProvider.xml [DEBUG] adding directory META-INF/maven/ [DEBUG] adding directory META-INF/maven/com.cgd.aisdc/ [DEBUG] adding directory META-INF/maven/com.cgd.aisdc/com.tibco.custom.jms.provider/ [DEBUG] adding entry META-INF/maven/com.cgd.aisdc/com.tibco.custom.jms.provider/pom.xml [DEBUG] adding entry META-INF/maven/com.cgd.aisdc/com.tibco.custom.jms.provider/pom.properties [INFO] BW Module Packager Mojo finished execution.

running it on my dev env machines: [INFO] --- bw6-maven-plugin:2.8.1:bwmodule (default-bwmodule) @ com.tibco.custom.jms.provider --- [DEBUG] Configuring mojo com.tibco.plugins:bw6-maven-plugin:2.8.1:bwmodule from plugin realm ClassRealm[extension>com.tibco.plugins:bw6-maven-plugin:2.8.1, parent: sun.misc.Launcher$AppClassLoader@7852e922] [DEBUG] Configuring mojo 'com.tibco.plugins:bw6-maven-plugin:2.8.1:bwmodule' with basic configurator --> [DEBUG] (f) classesDirectory = /apps/appmanage/workspaces/W10602/com.tibco.custom.jms.provider/target/classes [DEBUG] (f) outputDirectory = /apps/appmanage/workspaces/W10602/com.tibco.custom.jms.provider/target [DEBUG] (f) project = MavenProject: com.cgd.aisdc:com.tibco.custom.jms.provider:1.0.0-SNAPSHOT @ /apps/appmanage/workspaces/W10602/com.tibco.custom.jms.provider/pom.xml [DEBUG] (f) projectBasedir = /apps/appmanage/workspaces/W10602/com.tibco.custom.jms.provider [DEBUG] (f) qualifierReplacement = timestamp [DEBUG] (f) session = org.apache.maven.execution.MavenSession@11b377c5 [DEBUG] -- end configuration -- [INFO] Module Packager Mojo started for Module com.tibco.custom.jms.provider ... [INFO] Updated the Manifest version [INFO] The OSGi verion is 1.0.0.202111021653 for Maven version of 1.0.0.202111021653 [INFO] Removing the externals entries if any. [DEBUG] Bundle Classpath before removing externals is .,lib/activemq-all-5.16.2.jar [DEBUG] Bundle Classpath after removing externals is .,lib/activemq-all-5.16.2.jar [DEBUG] Creating Plugin JAR from name com.tibco.custom.jms.provider [INFO] Created Plugin JAR with name /apps/appmanage/workspaces/W10602/com.tibco.custom.jms.provider/target/com.tibco.custom.jms.provider_1.0.0.202111021653.jar [DEBUG] BinInclude list is [META-INF/, OSGI-INF/customJMSProvider.xml, lib/*.jar, ., bin/] [DEBUG] BinExclude list is [] [INFO] Adding Maven Dependencies to the Plugin JAR file [DEBUG] Adding Maven dependencies to the JAR file [DEBUG] Looking up dependency tree for the current project => MavenProject: com.cgd.aisdc:com.tibco.custom.jms.provider:1.0.0-SNAPSHOT @ /apps/appmanage/workspaces/W10602/com.tibco.custom.jms.provider/pom.xml and the current session => org.apache.maven.execution.MavenSession@11b377c5 [DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=12263, ConflictMarker.markTime=12331, ConflictMarker.nodeCount=2, ConflictIdSorter.graphTime=3277, ConflictIdSorter.topsortTime=6828, ConflictIdSorter.conflictIdCount=1, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=65731, ConflictResolver.conflictItemCount=1, DefaultDependencyCollector.collectTime=99020, DefaultDependencyCollector.transformTime=110947} [DEBUG] com.cgd.aisdc:com.tibco.custom.jms.provider:bwmodule:1.0.0-SNAPSHOT [DEBUG] tempbw:activemq-all-5.16.2:jar:0.0.0:compile [DEBUG] org.apache.maven.project.DefaultDependencyResolutionResult@784abd3e [DEBUG] [tempbw:activemq-all-5.16.2:jar:0.0.0 (compile)] [DEBUG] Adding artifact for dependency => tempbw:activemq-all-5.16.2:jar:0.0.0 (compile). The file for Dependency is => /apps/m2repo/tempbw/activemq-all-5.16.2/0.0.0/activemq-all-5.16.2-0.0.0.jar [DEBUG] Final Bundle-Classpath is .,lib/activemq-all-5.16.2.jar [INFO] Creating the Plugin JAR file [INFO] Building jar: /apps/appmanage/workspaces/W10602/com.tibco.custom.jms.provider/target/com.tibco.custom.jms.provider_1.0.0.202111021653.jar [DEBUG] adding directory META-INF/ [DEBUG] adding entry META-INF/MANIFEST.MF [DEBUG] adding directory bin/ [DEBUG] adding directory bin/com/ [DEBUG] adding directory bin/com/tibco/ [DEBUG] adding directory bin/com/tibco/custom/ [DEBUG] adding directory bin/com/tibco/custom/jms/ [DEBUG] adding directory bin/com/tibco/custom/jms/provider/ [DEBUG] adding directory OSGI-INF/ [DEBUG] adding entry OSGI-INF/customJMSProvider.xml [DEBUG] adding entry bin/com/tibco/custom/jms/provider/Activator.class [DEBUG] adding entry bin/com/tibco/custom/jms/provider/CustomJMSProvider.class [DEBUG] adding directory lib/ [DEBUG] adding entry lib/activemq-all-5.16.2.jar [DEBUG] adding directory META-INF/maven/ [DEBUG] adding directory META-INF/maven/com.cgd.aisdc/ [DEBUG] adding directory META-INF/maven/com.cgd.aisdc/com.tibco.custom.jms.provider/ [DEBUG] adding entry META-INF/maven/com.cgd.aisdc/com.tibco.custom.jms.provider/pom.xml [DEBUG] adding entry META-INF/maven/com.cgd.aisdc/com.tibco.custom.jms.provider/pom.properties [INFO] BW Module Packager Mojo finished execution.

It lacks the com/tibco/* entries and I cannot understand why.

++This results in a class not found error as the bw appnode seems to not look for the .class files under the bin folder.

++From what I understand this packaging being done by the bw maven plugin it self as the pom.xml from my project specifies: bwmodule which, as you can see, is the exact same version on both local and dev environment (2.8.1)

VascoGilMesquita avatar Nov 02 '21 17:11 VascoGilMesquita

So I found a kind of "workaround" for this.

  1. Right click on the project, Properties > Java Build Path and check the option "Allow output folder for source folders", press [OK]
  2. Build your Project
  3. Check if the /target/classes/* folder has the .class files

Now if you do a "maven package/install/deploy" your package will contain the .class files. Problem is... this is not being done in build time which I don't think it's suitable.

VascoGilMesquita avatar Nov 16 '21 15:11 VascoGilMesquita

@Strickmabil Thank you. I found that class is being created for me but is in the /bin folder now but I have to move this to the expected location which is different when ear is created using Studio. So I could workaround by manually moving it to correct path and then creating the ear so the class folder/file gets included but like you said it is a "workaround".

shylajasastry avatar Nov 18 '21 10:11 shylajasastry