What I do which I find very helpful is the following:
<project name="MyProject" default="package"> <property environment="env"/> <property file="build.properties"/> <property name="project.dir" location="."/> <property name="mvn" value="${env.MAVEN_HOME}\bin\mvn.bat"/> <!-- Feel free to remove the test.skip --> <property name="test.skip" value="true"/> <target name="mvn"> <exec dir="${project.dir}" executable="${mvn}"> <arg line="-Dmaven.test.skip=${test.skip} ${goal}"/> </exec> </target> <target name="clean"> <antcall target="mvn"> <param name="goal" value="clean"/> </antcall> </target> <target name="process-resources"> <antcall target="mvn"> <param name="goal" value="process-resources"/> </antcall> </target> <target name="compile"> <antcall target="mvn"> <param name="goal" value="compile"/> </antcall> </target> <target name="package"> <antcall target="mvn"> <param name="goal" value="package"/> </antcall> </target> <target name="install"> <antcall target="mvn"> <param name="goal" value="install"/> </antcall> </target> </project> Copy this build file to the Ant View and just double click for one touch builds. I don't know if this is "best practices" but I find it much better than using the External Tool stuff in Eclipse. You can also do quick deploys since you don't have to startup the whole Maven build engine (i.e. just simple Ant copies of EARs and WARs etc.). -aps On 2/14/07, Wayne Fay <[EMAIL PROTECTED]> wrote:
I don't use Eclipse much of the time so I'm probably not the right person to ask. I switch between Eclipse, Netbeans, Idea, and other tools depending on what I'm doing. Rather than rely on IDE plugins, I just use Maven from the command line. I'd suggest you just plan to get used to the command line rather than worrying about Eclipse plugins too much. Wayne On 2/14/07, lightbulb432 <[EMAIL PROTECTED]> wrote: > > Oh wow, that sounds handy. > > Now is there an Eclipse plugin you could recommend that does that all from > within Eclipse? Currently I do nearly all development within Eclipse, and > I'd strongly prefer not to have to jump back and forth from command-line > outside Eclipse to a GUI within it...I prefer the latter. > > Maybe some of you could describe your experiences with the maven Eclipse > plugins and whether they're a convenience...(maybe recommend what you use?) > > Thanks? > > > > Wayne Fay wrote: > > > > For Maven to work, you need the dependencies set up properly in your > > pom.xml file. > > > > For Eclipse to work, you need the build path set up properly in your > > .classpath file. > > > > The Maven Eclipse plugin simply writes out an Eclipse .classpath file > > from the dependencies listed in your Maven pom.xml, so you really only > > need to manage the dependencies in one place, and generate the other. > > > > Wayne > > > > On 2/14/07, lightbulb432 <[EMAIL PROTECTED]> wrote: > >> > >> My biggest point of confusion on this is the intermingling of the "Build > >> Path" set within Eclipse (which creates a .classpath file) and the > >> "dependencies" set in the pom.xml. How are these the same, and how are > >> the > >> different? Do both still need to be used? > >> > >> So in your case are you not using any Maven plugin, essentially just > >> editing > >> your POMs from within Eclipse as a regular XML file? > >> > >> On a slightly related note, I haven't been able to find a DTD/XSD for > >> pom.xml, so Eclipse won't do autocomplete or validation for my pom.xml, > >> which would be nice as I'm just learning this... > >> > >> > >> > >> franz see wrote: > >> > > >> > Good day, > >> > > >> > Personally, I still use maven in the command line, and Eclipse as an > >> > editor. > >> > > >> > What I do is that > >> > 1. I go to the directory of my maven project > >> > 2. Do mvn "eclipse:clean eclipse:eclipse" ( "eclipse:clean" is to make > >> > sure I start with a clean slate ) > >> > 3. Then create the eclipse project from an existing source ( where the > >> > source is the the directory in #1 ). > >> > > >> > As for the commands, you can do "mvn --help" to see the options > >> available. > >> > Other than that, you can enter either a goal or a lifecycle phase ( see > >> > [1] about their difference ). But for beginners, executing maven > >> commands > >> > based on lifecycle phases are usually enough. > >> > > >> > Cheers, > >> > Franz > >> > > >> > [1] > >> > > >> http://maven.apache.org/guides/introduction/introduction-to-the-pom.html > >> ( > >> > official version ) > >> > [2] > >> > > >> http://docs.codehaus.org/display/MAVENUSER/introduction-to-the-lifecycle > >> ( > >> > wiki'd version ) > >> > > >> > > >> > lightbulb432 wrote: > >> >> > >> >> I understand there are Eclipse IDE plugins, but from downloading and > >> >> trying one of them it seems like there's very little it actually does > >> (at > >> >> least from what I can tell), and they're quite poorly documented for > >> >> total beginners like me. > >> >> > >> >> Based on your experience, do you mostly use Maven from the > >> command-line? > >> >> What types of things do you do within Eclipse with Maven to simplify > >> your > >> >> development process? > >> >> > >> >> Could you recommend what a good Eclipse plugin would be? I've seen a > >> >> couple, and I really can't tell which is comparatively the best...some > >> >> suggestions would be appreciated. > >> >> > >> > > >> > > >> > >> -- > >> View this message in context: > >> http://www.nabble.com/Maven-from-command-line-only--tf3225422s177.html#a8967475 > >> Sent from the Maven - Users mailing list archive at Nabble.com. > >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > View this message in context: http://www.nabble.com/Maven-from-command-line-only--tf3225422s177.html#a8967856 > Sent from the Maven - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- "What lies behind us and what lies in front of us is of little concern to what lies within us." -Ralph Waldo Emerson