Hi all,
we are trying to move our build environment to Jazz and are struggeling with our existing Ant scripts.
<project name="BaseSolutionPluginBuild" default="generateConfig" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<import file="/opt/jazz/TeamConcertBuildsystem/buildsystem/buildtoolkit/BuildToolkitTaskDefs.xml"/>
<property name="workspaceDirectory" value="${basedir}/../"/>
<property name="buildApplicationJar" value="IsovBuildApplication.jar"/>
<target name="generateConfig">
<fail message="Property 'project' required" unless="project" />
<fail message="Property 'clientEnvironmentId' required" unless="clientEnvironmentId" />
<fail message="Property 'serverEnvironmentId' required" unless="serverEnvironmentId" />
<startBuildActivity label="before loading pom file ..." autoComplete="true" buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${jazz.user.name}" password="${jazz.user.password}" />
<artifact:pom id="pom" file="pom.xml" />
<artifact:dependencies filesetId="pom.fileset" versionsId="pom.versions">
<pom refid="pom" />
</artifact:dependencies>
<startBuildActivity verbose="true" label="executing java to generate config ..." autoComplete="true" buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${jazz.user.name}" password="${jazz.user.password}" />
<java classname="com.ibm.isov.tools.build.BuildConsole" failonerror="true" output="${basedir}/../java-generate-config.log">
<arg value="-workspaceDirectory=${workspaceDirectory}"/>
<arg value="-project=${project}"/>
<arg value="-clientEnvironmentId=${clientEnvironmentId}"/>
<arg value="-serverEnvironmentId=${serverEnvironmentId}"/>
<classpath>
<path location="${buildApplicationJar}" />
<path id="classpath">
<fileset refid="pom.fileset" />
</path>
</classpath>
</java>
<logPublisher filePath="${basedir}/../java-generate-config.log" label="Maven Initialize Database Log" buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${jazz.user.name}" password="${jazz.user.password}" />
</target>
</project>
We have added a few startBuildActivity tasks to the existing script. The strange thing is, that the first startBuildActivity are working, but after the maven ant tasks are being used, we get a NPE during the execution of the startBuildActivity task (line 20).
<startBuildActivity verbose="true" label="executing java to generate config ..." autoComplete="true" buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${jazz.user.name}" password="${jazz.user.password}" />
com.ibm.team.repository.common.transport.ServiceMethodInvocationError: java.lang.NullPointerException
at com.ibm.team.repository.transport.client.RemoteTeamService.getAppropriateException(RemoteTeamService.java:505)
at com.ibm.team.repository.transport.client.RemoteTeamService.executeMethod(RemoteTeamService.java:416)
at com.ibm.team.repository.transport.client.RemoteTeamService.invoke(RemoteTeamService.java:176)
at com.ibm.team.repository.transport.client.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:43)
at $Proxy0.describe(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at com.ibm.team.repository.client.internal.ServiceInterfaceProxy.invokeServiceCall(ServiceInterfaceProxy.java:145)
at com.ibm.team.repository.client.internal.ServiceInterfaceProxy.invoke(ServiceInterfaceProxy.java:80)
at $Proxy0.describe(Unknown Source)
at com.ibm.team.repository.client.internal.TeamRepository$4.run(TeamRepository.java:1220)
at com.ibm.team.repository.client.internal.TeamRepository$4.run(TeamRepository.java:1)
at com.ibm.team.repository.client.internal.TeamRepository$3.run(TeamRepository.java:1061)
at com.ibm.team.repository.common.transport.CancelableCaller.call(CancelableCaller.java:76)
at com.ibm.team.repository.client.internal.TeamRepository.callCancelableService(TeamRepository.java:1054)
at com.ibm.team.repository.client.internal.TeamRepository.internalLogin(TeamRepository.java:1213)
at com.ibm.team.repository.client.internal.TeamRepository.login(TeamRepository.java:480)
at com.ibm.team.build.ant.task.AbstractTeamBuildTask.getTeamRepository(AbstractTeamBuildTask.java:190)
at com.ibm.team.build.ant.task.AbstractPublisherTask.getBuildResult(AbstractPublisherTask.java:167)
at com.ibm.team.build.ant.task.AbstractPublisherTask.doExecute(AbstractPublisherTask.java:112)
at com.ibm.team.build.ant.task.AbstractTeamBuildTask.execute(AbstractTeamBuildTask.java:344)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.NullPointerException
at com.ibm.team.repository.common.internal.marshal.util.WebServicesSAXXMLHandler.createObjectFromFactory(WebServicesSAXXMLHandler.java:55)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1270)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1336)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:970)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:953)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:684)
at com.ibm.team.repository.common.internal.marshal.util.SAXWrapper.startElement(SAXWrapper.java:73)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:179)
at com.ibm.team.repository.common.internal.marshal.util.WebServicesXMLLoadImpl.load(WebServicesXMLLoadImpl.java:76)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:180)
at com.ibm.team.repository.common.internal.marshal.impl.EObjectMarshaller.demarshalInputStreamToObject(EObjectMarshaller.java:491)
at com.ibm.team.repository.transport.client.RemoteTeamService.demarshallEnvelope(RemoteTeamService.java:476)
at com.ibm.team.repository.transport.client.RemoteTeamService.invokePost(RemoteTeamService.java:443)
at com.ibm.team.repository.transport.client.RemoteTeamService.executeMethod(RemoteTeamService.java:392)
... 87 more
If we remove the usage of the maven ant task (lines 15 to 18) the script is working well.
<artifact:pom id="pom" file="pom.xml" />
<artifact:dependencies filesetId="pom.fileset" versionsId="pom.versions">
<pom refid="pom" />
</artifact:dependencies>
Does anybody have an idea what the problem could be with the maven ant tasks?
Thanks for any help!
Regards,
Thomas