Golder rule of build scripts: If they are not broken, don't fix them

Now if you want to refactor your build scripts from ANT to Maven
(which IMHO is a good thing) here is what I would recommend:

1. Set up a Maven Repository Manager (I use nexus, but there are
others, e.g. artifactory)

2. Start by adding Maven ANT Tasks to your ANT builds scripts.

2.1 Add an <artifact:deploy> to deploy your artifacts to the Maven
Repository Manager.
2.2 New projects can use Maven.
2.3 Stop using the "big bag of jars" lib folder concept and pull down
the intra-project artifacts from the MRM in the ANT build scripts

3. Take the ANT projects one at a time and convert to Maven
projects... if you do this slowly, you can probably keep the ANT build
script working in parallel.

Once you have passed step 2.1 above, you are free to mavenize projects
at leasure

HTH

-Stephen

2009/12/2 Vijay Venkataraman <vijay.venkatara...@gmail.com>:
> Hi Anders
>
> You are right. Unfortunately all the product builds are ant builds and there
> is no central repository concept which holds the artifacts in the way that
> is prescribed by maven. Again i cannot change all those pieces one shot. I
> want to try this out on one project and then slowly work on moving other
> pieces one by one.
>
> Thanks,
> Vijay
>
> On Tue, Dec 1, 2009 at 11:21 PM, Anders Hammar <and...@hammar.net> wrote:
>
>> Any reason why you're trying to build your own solution instead of going
>> the
>> Maven way by setting up a corporate repository populated with these
>> artifacts? Not only would it be the right solution, my guess is that it
>> would be so much easier than going against Maven.
>>
>> /Anders
>>
>> On Wed, Dec 2, 2009 at 07:06, Vijay Venkataraman <
>> vijay.venkatara...@gmail.com> wrote:
>>
>> > Hi,
>> > Currently i am trying to get maven project setup which creates a jar
>> > artifact. I have setup the project structure.
>> > Unfortunately i we don't have the libraries in central repository as per
>> > maven layout and jars don't have version numbers.
>> > They are jars like product1.jar, product2.jar. These jars are the project
>> > dependencies.
>> > I was thinking of running ant task which will move the jars to necessary
>> > location and rename the jars during validate phase. After which i expect
>> > the
>> > compile to execute.
>> >
>> > But i see that dependency resolution happens first before any tasks can
>> be
>> > executed. Is it that i should write a separate ant script to do this
>> before
>> > running maven.
>> > I am using maven 2.1.0.
>> >
>> > Is there a better way to accomplish this?
>> >
>> > Thanks,
>> > Vijay
>> >
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to