Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Can't get simple lifecycleMapping to work in plugin

Can you please open a bugreport and explain what happened? At very least
m2e should provide enough logging to allow troubleshooting of problems
like this.

--
Regards,
Igor

On 11-06-28 1:00 AM, Spencer Uresk wrote:
Actually, this turned out to be another plugin defining some improper
pluginExecution configuration, which silently broke a lot of stuff.
Sorry for the false alarm.

- Spencer

On Mon, Jun 27, 2011 at 1:35 PM, Spencer Uresk <suresk@xxxxxxxxx
<mailto:suresk@xxxxxxxxx>> wrote:

    Thanks, but I already have the extension point included. I also have
    added the lifecycle-mapping-metadata.xml entry to build.properties,
    but neglected to mention that in my original email.

    - Spencer


    On Mon, Jun 27, 2011 at 1:09 PM, David Carver <d_a_carver@xxxxxxxxx
    <mailto:d_a_carver@xxxxxxxxx>> wrote:

        __
        All you need to do is include the extension point as follows:


        <extension

        point="org.eclipse.m2e.core.lifecycleMappingMetadataSource">
        </extension>

        And make sure you have your lifecycle-mapping-metadata.xml file
        in the root of your contributing plugin. (Don't forget to add it
        to the build.properties file as well so it gets included).

        Dave


        On 06/27/2011 03:04 PM, Spencer Uresk wrote:
        I'm using m2e 1.0 and I'm running into a small problem (or,
        more likely, lack of understanding on my part) with some
        lifecycleMapping configuration. Here is the situation:

        We have a custom maven packaging type (tomcat-deployable).
        When a project with that packaging type is imported into
        Eclipse, we want the resources:resources goal to be run on it
        (and nothing else - it isn't a Java project). I got it working
        by adding the following to the POM:

        <pluginManagement>
        <plugins>
        <plugin>
        <groupId>org.eclipse.m2e</groupId>
        <artifactId>lifecycle-mapping</artifactId>
        <version>1.0.0</version>
        <configuration>
        <lifecycleMappingMetadata>
        <pluginExecutions>
        <pluginExecution>
        <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <versionRange>[2.0.0,]</versionRange>
        <goals>
        <goal>resources</goal>
        </goals>
        </pluginExecutionFilter>
        <action>
        <execute />
        </action>
        </pluginExecution>
        </pluginExecutions>
        </lifecycleMappingMetadata>
        </configuration>
        </plugin>
        </plugins>
        </pluginManagement>

        This works fine for one project, but I want to make a plugin
        to handle this so that every project we have doesn't have to
        do this. So, in one of our plugins, I added the following:

        In lifecycle-mapping-metadata.xml:

        <lifecycleMappingMetadata>
        <lifecycleMappings>
        <lifecycleMapping>
        <packagingType>tomcat-deployable</packagingType>
        <lifecycleMappingId>org.lds.stack.ide.tomcatDeployableLifecycleMapping</lifecycleMappingId>
        <pluginExecutions>
        <pluginExecution>
        <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <versionRange>[2.0.0,)</versionRange>
        <goals>
        <goal>resources</goal>
        </goals>
        </pluginExecutionFilter>
        <action>
        <execute />
        </action>
        </pluginExecution>
        </pluginExecutions>
        </lifecycleMapping>
        </lifecycleMappings>
        </lifecycleMappingMetadata>

        In the corresponding plugin.xml:

        <extension
        point="org.eclipse.m2e.core.lifecycleMappingMetadataSource" />
        <extension point="org.eclipse.m2e.core.lifecycleMappings">
        <lifecycleMapping

         class="org.lds.stack.ide.TomcatDeployableLifecycleMapping"
                 id="org.lds.stack.ide.tomcatDeployableLifecycleMapping"
                 name="Tomcat Deployable Lifecycle Mapping" />
        </extension>

        This doesn't cause the resources goal to be run, however. I do
        see the following in the Eclipse logs:

        11:47:15.560 [Worker-10] INFO
         o.e.m.c.u.i.UpdateConfigurationJob - Update started
        11:47:15.562 [Worker-10] DEBUG
        o.e.m.c.i.p.r.ProjectRegistryManager - Refreshing:
        [/keystone-deploy/pom.xml]
        11:47:15.567 [Worker-10] DEBUG
        o.e.m.c.internal.embedder.MavenImpl - Reading Maven project:
        C:\dev\eclipse-indigo\runtime-ldstech\keystone\deploy\pom.xml
        11:47:15.592 [Worker-10] DEBUG
        o.e.m.c.internal.embedder.MavenImpl - Read Maven project:
        C:\dev\eclipse-indigo\runtime-ldstech\keystone\deploy\pom.xml
        in 25 ms
        11:47:15.814 [Worker-10] DEBUG
        o.e.m.c.i.l.LifecycleMappingFactory - Loading lifecycle
        mapping for MavenProject: org.lds.keystone:keystone-deploy:1.0
        @ C:\dev\eclipse-indigo\runtime-ldstech\keystone\deploy\pom.xml.
        11:47:15.878 [Worker-10] INFO
         o.e.m.c.i.l.LifecycleMappingFactory - Using
        org.lds.stack.ide.tomcatDeployableLifecycleMapping lifecycle
        mapping for MavenProject: org.lds.keystone:keystone-deploy:1.0
        @ C:\dev\eclipse-indigo\runtime-ldstech\keystone\deploy\pom.xml.
        11:47:15.878 [Worker-10] DEBUG
        o.e.m.c.i.l.LifecycleMappingFactory - Loaded lifecycle mapping
        in 64 ms for MavenProject:
        org.lds.keystone:keystone-deploy:1.0 @
        C:\dev\eclipse-indigo\runtime-ldstech\keystone\deploy\pom.xml.
        11:47:15.879 [Worker-10] DEBUG
        o.e.m.c.i.p.r.DefaultMavenDependencyResolver - Resolving
        dependencies for MavenProject:
        org.lds.keystone:keystone-deploy:1.0 @
        C:\dev\eclipse-indigo\runtime-ldstech\keystone\deploy\pom.xml
        11:47:15.879 [Worker-10] DEBUG
        o.e.m.c.internal.embedder.MavenImpl - Reading Maven project:
        C:\dev\eclipse-indigo\runtime-ldstech\keystone\deploy\pom.xml
        11:47:15.911 [Worker-10] DEBUG
        o.e.m.c.internal.embedder.MavenImpl - Read Maven project:
        C:\dev\eclipse-indigo\runtime-ldstech\keystone\deploy\pom.xml
        in 32 ms
        11:47:15.912 [Worker-10] DEBUG
        o.e.m.c.i.p.r.DefaultMavenDependencyResolver - Resolved
        dependencies for MavenProject:
        org.lds.keystone:keystone-deploy:1.0 @
        C:\dev\eclipse-indigo\runtime-ldstech\keystone\deploy\pom.xml
        in 33 ms
        11:47:15.913 [Worker-10] DEBUG
        o.e.m.c.i.p.r.ProjectRegistryManager - Refreshed:
        [/keystone-deploy/pom.xml]
        11:47:15.983 [Worker-10] DEBUG
        o.e.m.c.i.p.ProjectConfigurationManager - Updating project
        configuration for MavenProject:
        org.lds.keystone:keystone-deploy:1.0 @
        C:\dev\eclipse-indigo\runtime-ldstech\keystone\deploy\pom.xml.
        11:47:15.986 [Worker-10] DEBUG
        o.e.m.c.i.p.ProjectConfigurationManager - Updated project
        configuration for MavenProject:
        org.lds.keystone:keystone-deploy:1.0 @
        C:\dev\eclipse-indigo\runtime-ldstech\keystone\deploy\pom.xml
        in 3 ms.
        11:47:15.986 [Worker-10] INFO
         o.e.m.c.u.i.UpdateConfigurationJob - Update completed: 0 sec

        So, it appears to be picking up my lifecycle mapping, but
        nothing actually happens as far as I can tell.

        Any ideas as to what I'm missing?

        Thanks,

        - Spencer


        _______________________________________________
        m2e-users mailing list
        m2e-users@xxxxxxxxxxx  <mailto:m2e-users@xxxxxxxxxxx>
        https://dev.eclipse.org/mailman/listinfo/m2e-users


        _______________________________________________
        m2e-users mailing list
        m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>
        https://dev.eclipse.org/mailman/listinfo/m2e-users





_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users


Back to the top