-
1. Re: exploded EAR with Maven 2
asookazian Jan 15, 2010 6:45 AM (in response to asookazian)I decided to write a build.xml Ant script (based on a seamg-gen'd version first) that will be a refactor of the Maven parent and module pom.xml files.
Problems are the slowness of the builds in Maven, lack of exploded EAR/WAR option and the lack of fine-grained control. We're not using the site generation or report generation features of Maven. Maven life cycle is not configurable AFAIK (i.e. 'mvn install' execs all phases prior to and including install) unless you specify a sequence of plugin goals:
mvn resources:resources \ compiler:compile \ resources:testResources \ compiler:testCompile \ surefire:test \ jar:jar \ install:install
Also, in our project, only a local repo is used so if I want to do a mvn deploy then I have to download the maven-deploy-plugin and install it into the local repo (which is a PITA).
For dependency management, we can use Ivy with Ant from what I've read.
So what's the best plan of attack for refactoring a Maven build to Ant build?
-
2. Re: exploded EAR with Maven 2
kapitanpetko Jan 15, 2010 7:18 AM (in response to asookazian)
Arbi Sookazian wrote on Jan 15, 2010 06:45:
So what's the best plan of attack for refactoring a Maven build to Ant build?Before you go there, spend a little more time learning Maven. You can use profiles to customize your build,
you can also you use the antrun plugin to have bits of your build specified in Ant.If you say this in your profile, you get exploded archives. You can use antrun after that to copy them to
your deploy dir.... <build> <plugins> <plugin> <artifactId>maven-ear-plugin</artifactId> <configuration> <unpackTypes>ejb,war</unpackTypes> </confugration> </plugin> </plugins> </build>
HTH
-
3. Re: exploded EAR with Maven 2
lvdberg Jan 15, 2010 9:21 AM (in response to asookazian)Hi Arbi,
I completely agree with Nikolay; Don't downgrade your builds from Maven to Ant. It takes some time, especially to configure things withing Eclipse, but's worth the effort. Esapecially the reporting plug-ins are a must-have. Because Jboss tools is not (yet) nicely integrated with maven, you could split the development and deployment phase of your project. All development under Eclipse and when you're ready to run, do the Maven build with different profiles.
Leo
-
4. Re: exploded EAR with Maven 2
asookazian Jan 15, 2010 7:44 PM (in response to asookazian)Isn't the project directory structure different with Maven vs. Ant projects? So I'm not sure how I'd be able to maintain a dev build for Ant and a prod build for Maven simultaneously for the same project.
There are profiles in the parent pom.xml, so maybe I can use that with the <unpackTypes>. Unfortunately, our project is an EAR so we can't do hot incremental deployment of EJBs (which there are many!). Thx for the input.
-
5. Re: exploded EAR with Maven 2
kapitanpetko Jan 18, 2010 3:18 AM (in response to asookazian)
Arbi Sookazian wrote on Jan 15, 2010 19:44:
Isn't the project directory structure different with Maven vs. Ant projects? So I'm not sure how I'd be able to maintain a dev build for Ant and a prod build for Maven simultaneously for the same project.Why do you want an Ant dev build? If you decide to use Maven, you should use it for all profiles. I don't know what the exact differences
between your dev and prod setups are, but with some filters and different profiles, you should be able to set it up in Maven.