I have a LeanFT
project, it is working properly, when I execute it from IDE. I generated a jar file with maven-assembly-plugin
.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<mainClass>test.LeanFTest</mainClass>
</manifest>
</archive>
<finalName>${project.artifactId}-fatjar-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/leanft-assembly.xml</descriptor>
</descriptors>
</configuration>
</plugin>
When I try to execute it by TestExportTool(to generate XML file for ALM import) I get various error messages, like:
log4j: WARN JmDNS or serviceInfo not found
java.lang.UnsatisfiedLinkError: no NTEventLogAppender
java.lang.NoClassDefFoundError
I imported all the necessary classes, resolved these issues, but TestExportTool
comes with exceptions again and again.
I added these dependencies, reported by error messages, but these are not used by project, so not sure why it is asking for.
<dependency>
<groupId>org.jmdns</groupId>
<artifactId>jmdns</artifactId>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.dblock.log4jna</groupId>
<artifactId>log4jna-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.21</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
leanft-assembly.xml file:
<id>fat-tests</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<unpack>true</unpack>
<scope>test</scope>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>${project.build.directory}/test-classes</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.class</include>
</includes>
<useDefaultExcludes>true</useDefaultExcludes>
</fileSet>
</fileSets>
Detailed stack trace of latest error message:
Hewlett-Packard Enterprise LeanFT Test Export Tool. [main] DEBUG javax.jmdns.impl.JmDNSImpl - JmDNS instance created 2018-07-06 11:17:21,741 Exception in thread "main" java.lang.NoClassDefFoundErr or: org/apache/tools/ant/taskdefs/LogOutputStream at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.hp.lft.testexporttool.internal.JarFileLoader.getPublicClassesFrom JarFile(JarFileLoader.java:48) at com.hp.lft.testexporttool.internal.TestsExporter.export(TestsExporter .java:26) at com.hp.lft.testexporttool.ExportTests.main(ExportTests.java:41) Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.taskdefs.LogOu tputStream at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source)
UPDATE 07.09.: I added all the dependencies, requested by TestExportTool. I get following message from Hewlett-Packard Enterprise LeanFT Test Export Tool:
[main] DEBUG javax.jmdns.impl.JmDNSImpl - JmDNS instance created 2018-07-09 13:25:17,419 bshpath.BshClassLoader
Problem caused by JAR generation plugin in IntelliJ IDEA. I exported same project to Eclipse and generated JAR file under File -> Export option and file is working fine when executed from ALM.