How to publishing build results using maven?
I am able to build using the jazz build engine (jbe) with the maven
template. Now, I would like to publish the results using the ant tasks
defined by jazz. I run the maven-antrun-plugin to call
artifactFilePublisher, as an example. However, the build generates an error
indicating that it cannot find the class for the ant task:
Embedded error: taskdef A class needed by class
com.ibm.team.build.ant.task.ArtifactFilePublisherTask cannot be found:
org/apache/tools/ant/Task
I had assumed that the jbe call on the maven template would load the jazz
ant taks. But, that does not appear to be the case. I did also modify maven's
bin/m2.conf file to load the jazz jars. However, it appears that jbe does
not consider the m2.conf file.
Is there a way to include the proper classes in the classpath? (I do see
that there is a JVM option; however, typing out all the jars for the
classpath seems too cumbersome.)
Here's my ant plugin sample for maven:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<tasks>
- <Tasks>
<taskdef>
<artifactFilePublisher>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
template. Now, I would like to publish the results using the ant tasks
defined by jazz. I run the maven-antrun-plugin to call
artifactFilePublisher, as an example. However, the build generates an error
indicating that it cannot find the class for the ant task:
Embedded error: taskdef A class needed by class
com.ibm.team.build.ant.task.ArtifactFilePublisherTask cannot be found:
org/apache/tools/ant/Task
I had assumed that the jbe call on the maven template would load the jazz
ant taks. But, that does not appear to be the case. I did also modify maven's
bin/m2.conf file to load the jazz jars. However, it appears that jbe does
not consider the m2.conf file.
Is there a way to include the proper classes in the classpath? (I do see
that there is a JVM option; however, typing out all the jars for the
classpath seems too cumbersome.)
Here's my ant plugin sample for maven:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<tasks>
- <Tasks>
<taskdef>
<artifactFilePublisher>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
3 answers
I did get the artifact publisher working a while ago with maven.
Try this:
To use the toolkit, add this to maven/bin/m2.conf:
load C:\buildsystem\buildtoolkit\*.jar
load C:\ant\lib\*.jar
Of course, specify the correct paths.
To get the properties available so the ant snippet in the pom.xml can use
them, you need to add
-DbuildResultUUID=${buildResultUUID} -DrepositoryAddress=${repositoryAddress}
to the Java VM arguments field on the Maven page of the build definition.
---
Ryan Manwiller
Jazz Team Build
Try this:
To use the toolkit, add this to maven/bin/m2.conf:
load C:\buildsystem\buildtoolkit\*.jar
load C:\ant\lib\*.jar
Of course, specify the correct paths.
To get the properties available so the ant snippet in the pom.xml can use
them, you need to add
-DbuildResultUUID=${buildResultUUID} -DrepositoryAddress=${repositoryAddress}
to the Java VM arguments field on the Maven page of the build definition.
---
Ryan Manwiller
Jazz Team Build
Embedded error: taskdef A class needed by class
com.ibm.team.build.ant.task.ArtifactFilePublisherTask cannot be found:
org/apache/tools/ant/Task
I'm not really sure why this is happening. I've read a few places that people are having similar problems using Maven 3.x and the maven-antrun-plugin (and read somewhere it might have to do with a hierarchical project structure...)
In any regards, I also had this problem and the fix I found was to modify the pom.xml by adding the <classpath> element to the <taskdef> element and point it to your build toolkit jars. This is shown in the following example:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<tasks>
<taskdef name="startBuildActivity" classname="com.ibm.team.build.ant.task.StartBuildActivityTask" />
<classpath>
<fileset dir="C:\jazz\buildsystem\buildtoolkit">
<include name="*.jar" />
</fileset>
</classpath>
<!-- Replace ADMIN with your real credentials. -->
<startBuildActivity repositoryAddress="${repositoryAddress}"
userId="ADMIN"
password="ADMIN"
buildResultUUID="${buildResultUUID}"
autoComplete="true"
label="compiling..." />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
Hi,
I have implemented a Maven 3.x build at a client. The project consists of around 12 submodules. I have used the antrun plugin to track each module as an activity, as well as publishing JUnit results (specifying the classpath for each task def). However, when running the build, the build execution time has drammatically increased (from around 9 minutes to over 30 minutes - in fact it once ran for over 15 hours before I cancelled it!) and I have quite often received OutOfMemory errors on the Java Heap space.
It appears that by specifying the classpaths for each Toolkit Ant Task, the JBE is loading all the classes everytime which is causing the out of memory problem and the runing time issue.
My question: Is there no way of specifying the classpaths once, or is there another way of doing this?
I have currently commented out the StartActivity and JUnitLogPublisher tasks from the build scripts, so the builds are running as normal. But we are losing the benefits of fine-grained monitoring and JUnit results.
I'm not really sure why this is happening. I've read a few places that people are having similar problems using Maven 3.x and the maven-antrun-plugin (and read somewhere it might have to do with a hierarchical project structure...)
In any regards, I also had this problem and the fix I found was to modify the pom.xml by adding the <classpath> element to the <taskdef> element and point it to your build toolkit jars. This is shown in the following example:
I have implemented a Maven 3.x build at a client. The project consists of around 12 submodules. I have used the antrun plugin to track each module as an activity, as well as publishing JUnit results (specifying the classpath for each task def). However, when running the build, the build execution time has drammatically increased (from around 9 minutes to over 30 minutes - in fact it once ran for over 15 hours before I cancelled it!) and I have quite often received OutOfMemory errors on the Java Heap space.
It appears that by specifying the classpaths for each Toolkit Ant Task, the JBE is loading all the classes everytime which is causing the out of memory problem and the runing time issue.
My question: Is there no way of specifying the classpaths once, or is there another way of doing this?
I have currently commented out the StartActivity and JUnitLogPublisher tasks from the build scripts, so the builds are running as normal. But we are losing the benefits of fine-grained monitoring and JUnit results.
Embedded error: taskdef A class needed by class
com.ibm.team.build.ant.task.ArtifactFilePublisherTask cannot be found:
org/apache/tools/ant/Task
I'm not really sure why this is happening. I've read a few places that people are having similar problems using Maven 3.x and the maven-antrun-plugin (and read somewhere it might have to do with a hierarchical project structure...)
In any regards, I also had this problem and the fix I found was to modify the pom.xml by adding the <classpath> element to the <taskdef> element and point it to your build toolkit jars. This is shown in the following example:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<tasks>
<taskdef>
<classpath>
<fileset>
<include>
</fileset>
</classpath>
<Replace>
<startBuildActivity>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>