I agree about being better to create a plugin.

Will just have to find time for doing it, and good arguments to spend time
on a project that builds fine ;-)

I just found
http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html so
this will be a nice way to package my antrun script as a mojo.

Nico.

2007/8/8, Eric Redmond <[EMAIL PROTECTED]>:
>
> I hope you understand that "antrun" is meant to be a stop-gap solution - a
> way to ensure your ant code works in your project. Now that you have your
> project working you should really consider creating a plugin:goal using
> the
> script so you can extract ant from your pom.
>
> --
> Eric Redmond
> http://blog.propellors.net
>
> On 8/8/07, nicolas de loof <[EMAIL PROTECTED]> wrote:
> >
> > Based on your link, I don't need a profile but a (plugin) dependency to
> > antcontrib to use the <if> tag.
> >
> > My POM will the look more and more like an ant script. Maven is supposed
> > to
> > use profiles for such use cases. Why is there a limitation NOT to
> support
> > ${basedir} property in profile activation ? I understand not supporting
> > custom properties (that can be set by profiles after activation), but
> not
> > for default properties.
> >
> > I've created MNG-3140 for this...
> >
> > Nico.
> >
> > 2007/8/8, Eric Redmond <[EMAIL PROTECTED]>:
> > >
> > > Why would you need to duplicate it? Have the antrun code only run if a
> > > property is set - and only set that property under the profiles you
> want
> > > it
> > > to execute under.
> > >
> > > You can see how to active a block of ant code here in my book:
> > >
> >
> http://www.sonatype.com/book/lifecycle.html#a_structure_for_goal_execution
> > >
> > > --
> > > Eric Redmond
> > > http://blog.propellors.net
> > >
> > > On 8/6/07, nicolas de loof <[EMAIL PROTECTED]> wrote:
> > > >
> > > > The ant code required to make the generator work is huge, and
> > > duplicating
> > > > it
> > > > would be worst as running it twice.
> > > >
> > > > Thanks anyway for the suggestion
> > > >
> > > >
> > > > 2007/8/6, Wayne Fay <[EMAIL PROTECTED]>:
> > > > >
> > > > > Not ideal, but you could set up another profile that has the full
> > path
> > > > > from the parent, and specify that when running from the parent ie
> > > > > sql2java_top or something.
> > > > >
> > > > > Wayne
> > > > >
> > > > > On 8/6/07, nicolas de loof <[EMAIL PROTECTED]> wrote:
> > > > > > Hello,
> > > > > >
> > > > > > I'm using a code generator, and I'd like to avoid regeneration
> of
> > > code
> > > > > on
> > > > > > each build.
> > > > > >
> > > > > > I've set a profile to launch the generation using the antrun
> > plugin
> > > > > > The profile is active based on a generated file missing :
> > > > > >
> > > > > > <profile>
> > > > > >      <id>sql2java</id>
> > > > > >      <activation>
> > > > > >        <file>
> > > > >
> > >          <missing>target/generated-sources/sql2java.tstamp</missing>
> > > > > >        </file>
> > > > > >      </activation>
> > > > > >      <build>
> > > > > > ...
> > > > > >
> > > > > > As explained in
> > http://docs.codehaus.org/display/MAVENUSER/Profiles,
> > > I
> > > > > > cannot reference ${project.build.directory} in this path.
> > > > > > When I run "mvn install" from my parent POM, generator runs even
> > if
> > > > code
> > > > > > allready exist, as the project basedir is not the same as
> running
> > > from
> > > > > the
> > > > > > module.
> > > > > >
> > > > > > Is there any way to solve this ? Is there any plan for
> properties
> > > > > support in
> > > > > > profiles activation ?
> > > > > >
> > > > > > Nico.
> > > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > >
> >
>

Reply via email to