Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ant builds and dependent projects

 
Brian Mulholland
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I have a webapp project (lets call it A) that uses two other projects (let's call them B and C). B also depends on C. I am working in eclipse (speciifcally IBM's RAD). Right now, people are copying the jar from C into A and B and copying B into A. I can't depend that workspaces will always have all three projects, so i don't want to have project links, JARs is right. But I want to set up ant scripts so that if you had whatever combination of these projects in your workspace, as you made changes and build, JARs would be copied (if changed) into the projects that depend on them. I have an Ant build script for B and C, have added copy functions to them that are conditional, and even added a conditional copy ant script to A that does not build, but is triggered by the build.

But how can I control order? How can i make it so that if project C is modified that it will build first, andcopy into B and A and then trigger the build of B, which in turn copies, and then A gets built? And is my general approach right or is there a better practice?
 
Jayesh A Lalwani
Rancher
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Maven. Maven is designed to solve problems like these.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And use Maven in conjunction with a CI tool such as Jenkins. Jenkins understands Maven POM files are can automatically rebuilt (and retest) modules that depends on other modules.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic