It's all about the answers!

Ask a question

Integration with Maven with RTC 4.0.2 (Team concert plugin)

chung Lin (1046) | asked Dec 11 '13, 3:08 p.m.
retagged Dec 13 '13, 11:11 a.m. by David Lafreniere (4.6k7)
Our current setup is that we use invoke ant to trigger build.xml file whenever we run a build from Jenkins or RTC, but now we would like to implement the Ant build.xml that we have into maven pom.xml Does anyone have an idea how to implement this? 

Accepted answer

permanent link
Jeff Care (1.0k3633) | answered Dec 11 '13, 10:16 p.m.
You can use the antrun plugin in your POM to run Ant scripts, but I generally discourage people from doing that.

Given that you seem hung up on preserving your old Ant build.xml, what's your motivation for using Maven?
chung Lin selected this answer as the correct answer

chung Lin commented Dec 12 '13, 8:55 a.m.

Thanks for the answer Jeff! The reason why we want to use antrun is because the pom file we are working with is already very complex already so we don't want to further complicate with our integration.   :)

Jeff Care commented Dec 12 '13, 9:20 a.m.

I obviously don't know your situation, but it sounds like you are setting yourself up for failure.

Maven & Ant are very different tools: one is not better than the other, they are just different. It sounds like you are trying to migrate from Ant to Maven, yet you don't want to adopt the "Maven way" to do things: if so that's a recipe for disaster. Successful use of Maven requires bending your will to how things are done in the Maven world. It means decomposing your build.xml and translating it into configuration for the appropriate Maven plugins.

Antrun has it's place, but I always recommend to people that they only use it for situations where there no available mojo that does what they need.

2 other answers

permanent link
Scott Cowan (966310) | answered Dec 11 '13, 4:13 p.m.
You can't really map an Ant build.xml to a Maven pom.xml.  Ant is procedural and Maven is declarative.  Here's a short overview ...

You really need to start simple with and build up a pom.xml until all aspects of your build are covered.

chung Lin commented Dec 11 '13, 6:03 p.m.

 Is it possible to call ant task within maven? Would that still work with RTC?

Scott Cowan commented Dec 12 '13, 9:47 a.m.

Looks like Jeff's got you covered for the Ant run plugin.  I hope to demonstrate how to do this soon with a blog post.  You'll probably solve your problem before I get to it, but I will track my progress here, Update Jenkin plugin self-host build with progress, compile and test results using build toolkit Ant tasks ... then write a blog post or article. (289698)

permanent link
Jeff Care (1.0k3633) | answered Dec 11 '13, 3:32 p.m.
Maven does not use build.xml files. Perhaps you meant pom.xml ?

chung Lin commented Dec 11 '13, 3:40 p.m.

Yes, sorry about the confusion. What I meant is that how do I implement the Ant build.xml that we have into maven pom.xml. 


Your answer

Register or to post your answer.