Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

ant task startBuildActivity fails in Maven build after dependencies loaded. proxy server setting [SOLVED]

we have a maven build, that works fine. we need to use proxy in settings.xml to access outside the company firewall. 

we also want to see the status of the build along the way, so have added startBuildActivity statements to the build script. 

all works fine til maven resolves the dependencies, then leaves the proxy setting around in the environment, and the next startbuildActivity task fails,  cause it can't reach rtc thru the proxy. 

anyone have any good ideas how to solve this
common.rtc.startActivity:
     [echo] Starting Activity: ${activityId}: Cleaning workarea...
[startBuildActivity] Not using a proxy to reach https://dbjazz.intranet.sd.com/ccm/
[startBuildActivity] Started build activity "Cleaning workarea..." for build result "R4.2.P20140304-0939".

clean:
    [mkdir] Created dir: /export/gcs1/data/opt/jazz/buildsystem/buildengine/sandbox/...
    [mkdir] Created dir: /export/gcs1/data/opt/jazz/buildsystem/buildengine/sandbox/...
    [mkdir] Created dir: /export/gcs1/data/opt/jazz/buildsystem/buildengine/sandbox/...
   [delete] Deleting directory /export/gcs1/data/opt/jazz/buildsystem/buildengine/sandbox/...

coverage.clean:
    [mkdir] Created dir: /export/gcs1/data/opt/jazz/buildsystem/buildengine/sandbox/...
    [mkdir] Created dir: /export/gcs1/data/opt/jazz/buildsystem/buildengine/sandbox/...
     [echo] *** Running Ant with Java version: 1.6 ***

_cash.test.jre:
     [echo] *** Running Ant with Java version: 1.6 ***

common.rtc.startActivity:
     [echo] Starting Activity: ${activityId}: JRE tests
[startBuildActivity] Using proxy my-proxy.intranet.sd.com:8080 to reach https://server.intranet.sd.com/ccm/
[startBuildActivity] Ignoring the following exception because "failOnError" is set to false.
[startBuildActivity] com.ibm.team.repository.common.TeamRepositoryException: Error logging in to repository https://server.intranet.sd.com/ccm/.  Verify that the repository address and credentials to log in are correct.

0 votes



3 answers

Permanent link
 well, turns out this was easier than expected.. they had already made a small target routine to invoke the startBuildActivity,, so all we had to do was add 

<setproxy proxyhost=""/>

before the <startBuildActivity .../> task

Sam

can someone select this as the  Accepted answer please

1 vote

Comments

Good to hear.

I think only you can mark which answer is accepted.

I can't mark my own answer as accepted

 


Permanent link
Hi Sam. Are you invoking our Ant tasks directly from within the Maven POM, i.e. using maven-ant plugin?
If so, how are you getting the build toolkit libs on the class path?  We've had a lot of problems with this approach in the past.  We've had more success invoking Ant separately, either via maven-exec or a simple maven-ant to launch an external Ant, passing -lib {buildtoolkit dir} and the necessary target and -Ds for repositoryAddress, userId, password/passwordFile, buildResultUUID, and any other needed args. The main problem with that approach is that it's hard to pass back info that may be needed for a later task invocation, e.g. activity id, or request UUID if launching a child build.  But this approach might work for specifying the proxy, separately from what Maven's Java is doing.

See also https://jazz.net/wiki/bin/view/Main/BuildFAQ#How_do_I_run_JBE_or_the_Ant_task for info on system properties we look at for using a proxy. I'm not sure whether these would override any JVM-wide defaults though.

0 votes

Comments

thanks..  checking..  build/maven/... all makes my head hurt.. 


I want the 'ignoreproxy ' parameter..   ;->

something is contaminating the execution env. 


Permanent link
 its really an ant build, with maven tasks to hook the dependencies.  

<artifact:dependencies pathId="sd.dependency.classpath" pomrefid="xxxpom" settingsFile="${project.dir}/settings.xml">
<remoteRepository refid="sd-repository"/>
<remoteRepository refid="abc-repository"/>
</artifact:dependencies>

the settings.xml has the proxy configuration

when we add the rtc startbuildactivity to the targets that have dependencies, then the proxy gets set, and the rtc ant task fails. because the maven ant task didn't clean up after itself. 

<target name="javac" depends="libs, init.versioning" description="Compile java source to bytecode">
<mkdir dir="${project.classes.dir}" />
<javac fork="true" memoryinitialsize="256m" memorymaximumsize="1024m" srcdir="${project.src.dir}" includes="**" encoding="utf-8" destdir="${project.classes.dir}" source="${javac.src.level}" target="${javac.src.level}" includeantruntime="false" debug="true" >
<classpath refid="project.classpath" />
<classpath refid="sd.dependency.classpath"/> <--- this one does it
<compilerarg line="${javac.args}"/>
</javac>
<copy todir="${project.classes.dir}">
<fileset dir="${project.src.dir}" excludes="**/*.java" />
</copy>
</target>

I'll have an exact sample tomorrow

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 562

Question asked: Mar 04 '14, 3:31 p.m.

Question was seen: 6,425 times

Last updated: Mar 26 '14, 9:40 a.m.

Confirmation Cancel Confirm