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

This mapping applies to every use of maven-resources-plugin in all
workspace project. It's hard to tell for sure without looking at
CharsetConfigurer, but I guess this explains the observed behaviour, at
least the missing resources. Beyond better logging, I don't see how m2e
could handle this differently.

--
Regards,
Igor

On 11-06-29 8:54 PM, Spencer Uresk wrote:
Here is a little more background on what happened. I was trying to
figure out how all the new lifecycleMapping functionality was supposed
to work and accidentally left one of my plugins in a mis-configured
state. I was trying to figure out a way to get a configurator to run for
all projects, as I was trying to set the character set for all projects
(I basically wanted to get the functionality described in this issue
https://bugs.eclipse.org/bugs/show_bug.cgi?id=343927). In my
lifecycle-mapping-metadata.xml, I had this:

    <pluginExecutions>

<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<versionRange>[2.0,)</versionRange>
<goals>
<goal>resources</goal>
<goal>testResources</goal>
</goals>
</pluginExecutionFilter>
<action>
<configurator>
<id>org.lds.stack.ide.m2eclipse.plugin.charSetConfigurer</id>
</configurator>
</action>
</pluginExecution>
</pluginExecutions>

And in my plugin.xml, I had something like this (note the lack of a
secondaryTo attribute):

<configurator

class="org.lds.stack.ide.m2eclipse.configurers.CharsetConfigurer"
             name="Character Set Configurer"
             id="org.lds.stack.ide.m2eclipse.plugin.charSetConfigurer" />

This caused a whole bunch of stuff to break. It caused the initial
problem I described (and, in fact, the lifecycle mapping for that
scenario turned out to be unnecessary once I removed the bad
configuration). It also caused some really odd behavior with the m2e-wtp
plugin - stuff in src/main/resources wasn't getting copied to the target
directory, but pretty much everything (including test resources) was
getting copied out to the server if I unchecked 'serve module without
publishing'. All of this odd behavior came down to my rogue
pluginExecution/configurator.

I recognize this was an error on my part, and I'm not sure if there is
anything reasonable m2e can do in this case? Do you still want me to
create a bug with this info?

- Spencer

On Tue, Jun 28, 2011 at 12:38 AM, Igor Fedorenko <igor@xxxxxxxxxxxxxx
<mailto:igor@xxxxxxxxxxxxxx>> wrote:

    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>
        <mailto: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>
        <mailto: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.__tomcatDeployableLifecycleMappi__ng</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.__TomcatDeployableLifecycleMappi__ng"

            id="org.lds.stack.ide.__tomcatDeployableLifecycleMappi__ng"
                             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.__tomcatDeployableLifecycleMappi__ng
            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>
            <mailto:m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>>

            https://dev.eclipse.org/__mailman/listinfo/m2e-users
            <https://dev.eclipse.org/mailman/listinfo/m2e-users>



                _________________________________________________
                m2e-users mailing list
        m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>
        <mailto:m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>>

        https://dev.eclipse.org/__mailman/listinfo/m2e-users
        <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
        <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
    <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