[prev in list] [next in list] [prev in thread] [next in thread] 

List:       maven-user
Subject:    Is a Mojo default execution goal possible, leaving out the executions
From:       Martijn_Morriën <dj.escay () gmail ! com>
Date:       2009-10-14 10:30:28
Message-ID: e204f4b60910140330v27c74c5el441a02990e384c93 () mail ! gmail ! com
[Download RAW message or body]


Hi,

I'm writing a mojo that generates source files. Is it possible to get rid of
the required executions part in the pom?
My mojo already defines it should be used in the generate-sources phase. And
my plugin only contains 1 mojo.

/**
 * @goal mycodegenerator
 * @phase generate-sources
 * @requiresProject false
 */
public class MyCodeGenerator extends AbstractMojo

I use it as follows:

  <build>
    <plugins>
      <plugin>
        <groupId>mytest</groupId>
        <artifactId>mycodegenerator</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <executions>
          <execution>
            <goals>
              <goal>mycodegenerator</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

I would prefer to us it as follows, but it doesn't work for me:

  <build>
    <plugins>
      <plugin>
        <groupId>mytest</groupId>
        <artifactId>mycodegenerator</artifactId>
        <version>0.0.1-SNAPSHOT</version>
      </plugin>
    </plugins>
  </build>

Is this possible? I do not want to introduce a new packaging type.

Thank you, Martijn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic