Baptiste:

Thanks for the answer.  You're certainly right about needing the
extensions true line, and I do have that in my pom (below).  Note that
the error message I'm getting gives a complete list of all lifecycle
phases that are legal, and that the list does not include any of the
phases I've tried to define.  Note also that in the pom I ask for
packaging lenskit.  If I change that to something else, like "foo", I
get an error that foo is an unknown lifecycle.  So: it seems that
maven is picking up the lifecycle, but NOT changing its list of
built-in phases.

pom.xml in my test directory:

<project xmlns="http://maven.apache.org/POM/4.0.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.riedl</groupId>
  <artifactId>tryout-plugins</artifactId>
  <version>0.1</version>

  <packaging>lenskit</packaging>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>runtime</scope>
      <version>1.0.6</version>
    </dependency>

  </dependencies>

  <build>
    <plugins>

      <!-- Run with 'mvn validate' -->
      <plugin>
        <groupId>org.riedl</groupId>
        <artifactId>hello-lenskit-plugin</artifactId>
        <version>1.0-SNAPSHOT</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <phase>validate</phase>
            <configuration>
              <toWhom>LensKit</toWhom>
            </configuration>
            <goals>
              <goal>greet</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>
</project>


The error message:

[INFO] Scanning for projects...
[WARNING] Ignored invalid goal specification 'eval' from lifecycle
mapping for phase phase
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tryout-plugins 0.1
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.168s
[INFO] Finished at: Sat Sep 15 16:31:23 CDT 2012
[INFO] Final Memory: 5M/481M
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "analysis". You must specify a valid
lifecycle phase or a goal in the format <plugin-prefix>:<goal> or
<plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>.
Available lifecycle phases are: validate, initialize,
generate-sources, process-sources, generate-resources,
process-resources, compile, process-classes, generate-test-sources,
process-test-sources, generate-test-resources, process-test-resources,
test-compile, process-test-classes, test, prepare-package, package,
pre-integration-test, integration-test, post-integration-test, verify,
install, deploy, pre-site, site, post-site, site-deploy, pre-clean,
clean, post-clean. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with
the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException


On Sat, Sep 15, 2012 at 2:20 AM, Baptiste MATHUS <[email protected]> wrote:
> Hi John,
> I think it'd be better to see at least a part of your pom.xml. Even better
> to have a demo project showing the issue somewhere.
>
> Anyway, just a small guess: I suppose you defined a new packacking through
> a plugin, and you're using it in your pom, right?
> As your packaging is not one of core, I seem to remember (never had to
> create a lifecycle myself) you *have* to add
> the <extensions>true</extensions> tag to your plugin configuration (check
> it here <https://community.jboss.org/wiki/CreatingACustomLifecycleInMaven>).
>
> Did you do it?
>
> My 2 cents.
>
> 2012/9/15 John Riedl <[email protected]>
>
>> Hello everyone.  I'm a newbie to Maven, but have spent the last two
>> days beating my head against this problem ...
>>
>> I posted the long form of this question, with XML to:
>>
>> http://stackoverflow.com/questions/12433120/maven-creating-a-new-phase
>>
>> The short form that I'm hoping someone on this list can answer directly is:
>>
>> Has anyone been able to create a lifecycle that uses custom phases
>> like "analysis"?  I've been able to get everything else working with
>> my lifecycle, but I'm having no luck getting a custom phase to be
>> recognized, and I'm starting to lose hope that it's even possible.
>>
>> Thanks,
>> John
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>> --
>> Baptiste <Batmat> MATHUS - http://batmat.net
>> Sauvez un arbre,
>> Mangez un castor !
>> nbsp;!
>>  <[email protected]>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to