Alexander,
Not quite sure why you need an Ant build wrapper it is far easier to just use
Eclipse's external tools facility to run mvn for any selected folder
e.g.
Set up a new External Tool as follows :
Name: mvn clean install
Location: ${env_var:M2_HOME}/bin/mvn.bat
Working Directory: ${resource_loc}
Arguments: clean install
Then just select the folder or project in the Eclipse Java Tree
(folder must have a pom.xml in it) then select this external tool 'mvn
clean install' - once run once it will be on the drop down.
You can set up the common maven goals like this, then share the
External tools configuration by using the 'Common' tab and specifying
a folder that is under SCM.
At least this way you know Maven is behaving as it does from the
command line, periodically you need to run eclipse:eclipse, but this
can be done as above.
Also can set up an 'General Project' in Eclipse that points to your
local repo folder, this allows you to search this area and open pom
files if necessary.
On 17/09/2007, Carlos Sanchez <[EMAIL PROTECTED]> wrote:
> what eclipse plugin are you using? you should ask in its mailing list
> though dependeing on which one you use
>
> On 9/15/07, Marco Mistroni <[EMAIL PROTECTED]> wrote:
> > Hello,
> > sorry to hijack this hteread.. but i have a questionr egarding mvn &
> > eclipse integration
> >
> > somehow, even after i enable a maven project iva eclipse, the classpath in
> > eclipse is screwed up big time
> > i hav dfined a m2_repo variable, but still i am getting errors from all
> > import i do, like eclipse does not know
> > where to look for external packages i import (such as spring, log4j etc..)
> >
> > i ws wondering how i can enable eclipse to have same classpath as maven.....
> >
> > any help would be appreciated
> >
> > thanks and regards
> > marco
> >
> >
> > On 9/15/07, Carlos Sanchez <[EMAIL PROTECTED]> wrote:
> > >
> > > most of your steps can be done in Q4E by going to the "New project"
> > > wizard, "Ne Maven 2 project", choose the archetype and fill in the
> > > blanks
> > >
> > > On 9/14/07, Alexander Sack <[EMAIL PROTECTED]> wrote:
> > > > Hi Everybody:
> > > >
> > > > You know Eclipse/Maven2 integration at this point can be very confusing.
> > > > You have three plugins, two of which are ECLIPSE plugins that integrate
> > > > Maven2 while the other is a Maven2 plugin that happens to auto-generate
> > > > files for Eclipse. I wrote this below and I figured I would share to
> > > see if
> > > > it helps anyone else.
> > > >
> > > > The main advantages of Codehaus and Q4E (which I plan to try very soon
> > > but I
> > > > will assume it does similar things that Codehaus does) is that they
> > > > integrate the POM dependency graph as part of your Eclipse project's
> > > Build
> > > > Path, i.e. it autoupdates dependencies as you add them to the POM. The
> > > > maven-eclipse-plugin relies on creating a separate CLASSPATH CONTAINER
> > > > variable referenced in your .classpath file to use your local maven2
> > > > repository (the M2_REPO variable in the directions - btw this is typical
> > > for
> > > > other plugins like the JBoss tools). Unfortunately the latter is not as
> > > > dynamic when it comes to adding and deleting dependencies in your
> > > project.
> > > >
> > > > Codehaus installs on 3.1.x and up (I've used it with 3.1.1 specifically
> > > and
> > > > with 3.3 though for some reason its buggy under 3.3).
> > > >
> > > > What I do to setup a project is the following:
> > > >
> > > > - Use mvn archetype to setup the basic structure
> > > > - Create a new Java project with Maven2 nature enabled
> > > > - Import archetype directory structure into this project
> > > > - Edit the Build Path within Eclipse
> > > > - Use ant build file to execute mvn from within Eclipse
> > > >
> > > > Here is an example (I'm using Eclipse 3.1.1 w/Codehaus m2eclipse
> > > plugin):
> > > >
> > > > 1) In some temporary directory
> > > > mvn archetype:create -DgroupId=com.example.project-DartifactId=MyProject
> > > > 2) Edit pom.xml to packaging is pom, rm -rf the src directory
> > > > 3) Within MyProject use archetype plugin to create other modules which
> > > adds
> > > > them to parent module, e.g.
> > > >
> > > > mvn archetype create -DgroupId=com.example.project -DartifactId=ejb3
> > > > mvn archetype create -DgroupId=com.example.project -DartifactId=war
> > > >
> > > > This will create two sub modules, one for war, one for ejb3. You can
> > > change
> > > > the packaging to war and jar (or ejb) respectively.
> > > >
> > > > 4) Now go into Eclipse and do a new project MyProject and import the
> > > > MyProject you created above via Filesystem
> > > > 5) Enable Maven2 nature, now Maven2 dependencies will show up and
> > > > dynamically change as you edit your POM hierarchy
> > > > 6) Edit Build Path in Project's properties and remove
> > > MyProject. Instead
> > > > add the ejb3/src/main/java and war/src/main/java source folders.
> > > > 7) Check "Allow output folders for source folders"
> > > > 8) Now I use a generic build.xml ANT file to execute Maven2 such as
> > > this:
> > > >
> > > > <project name="MyProject" default="all">
> > > > <property environment="env"/>
> > > > <property file=" build.properties"/>
> > > >
> > > > <!-- Feel free to conditional this to execute the bat or shell
> > > depending
> > > > on OS -->
> > > > <property name="mvn" value="${env.MAVEN_HOME}\bin\mvn.bat"/>
> > > >
> > > > <target name="mvn">
> > > > <exec dir="${basedir}" executable="${mvn}">
> > > > <arg line="-P${maven.profile.list} -
> > > Dmaven.test.skip=true${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="site">
> > > > <antcall target="mvn">
> > > > <param name="goal" value="site"/>
> > > > </antcall>
> > > > </target>
> > > >
> > > > <target name="all">
> > > > <antcall target="package"/>
> > > > </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>
> > > >
> > > > Mine has some more stuff in it but you get the idea.
> > > >
> > > > 9) Now copy build.xml to Ant View and execute targets
> > > > 10) Remove the old MyProject you imported as now its part of your
> > > workspace
> > > > (I guess you could have not imported it originally which is an extra
> > > step)
> > > >
> > > > I have NO idea if this is what others do but this works great for my
> > > > builds. I can build from the command line using ant (as well as allow
> > > ant
> > > > to do some preprocessing that Maven2 might or might not be able to
> > > > accomplish as easy) as well as build from Eclipse. I have built several
> > > > products this way without any issue (nightly builds use the command
> > > line,
> > > > developers such as myself use Eclipse).
> > > >
> > > > Try it....hope this helps a little....I will play with Q4E with Europa
> > > > (which I want for just for the server instances stuff).
> > > >
> > > > Thanks!
> > > >
> > > > -aps
> > > >
> > > > --
> > > > "What lies behind us and what lies in front of us is of little concern
> > > to
> > > > what lies within us." -Ralph Waldo Emerson
> > > >
> > >
> > >
> > > --
> > > I could give you my word as a Spaniard.
> > > No good. I've known too many Spaniards.
> > > -- The Princess Bride
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
>
>
> --
> I could give you my word as a Spaniard.
> No good. I've known too many Spaniards.
> -- The Princess Bride
>
> ---------------------------------------------------------------------
> 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]