Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] Lifecycle mapping metadata configuration

Hey Fred,

Thanks for the input.  That makes sense know why it wasn't working before.  I am going to try to add both configurators one for the facets and one for invoking some of those custom goals during build participation. 

Greg


On Thu, Jan 10, 2013 at 6:17 PM, Fred Bricon <fbricon@xxxxxxxxx> wrote:
Greg,

When you configure your project configurator as secondary to the wtp one, that means that whenever you expect that configurator to be invoked when a liferay goal is found, m2e will try to invoke the wtp configurator first for that same liferay goal. Since the wtp configurator is not bound to any liferay plugin, it's not found hence the liferay configurator is not invoked.

2 configurators are the way to go if you need to do special things whenever thes goals are invoked. Looking at the code, you only want to add project Facets to your project, so technically, you don't need a configurator for the liferay plugin.
You should keep the one bound to maven-war-plugin, add your facets, and mark the liferay goals as ignored in your lifecycle mapping, at least for now. 

Fred Bricon

On Thu, Jan 10, 2013 at 11:08 AM, Greg Amerson <gregory.amerson@xxxxxxxxxxx> wrote:
Olivier, you found it! I simply added a new configurator that wasn't secondaryTo and it finds it now!  Wow, I've been banging my head up against this for several days, actually its caused me to put this task down at least 3 times because I would get stuck here.  

Thanks so much!


On Thu, Jan 10, 2013 at 5:50 PM, Olivier NOUGUIER <olivier.nouguier@xxxxxxxxx> wrote:
Hum
 I have a similar project [1] and the only difference I can see is that you are using the same 

                <configurator>
                    <id>com.liferay.ide.maven.core.project.configurator</id>
                </configurator>

in two "pluginExecution" look like if only the first is running !

You shoud try not to reuse the same configurator on different pluginExecutions.





On Thu, Jan 10, 2013 at 10:19 AM, Greg Amerson <gregory.amerson@xxxxxxxxxxx> wrote:
Ok, I just let the import finish, the pom.xml is marked up in the place where the goals are that it can't understand (attached screenshot).  Then I also did as you suggested and ran the Maven > Update project... ,and I've attached the console output.  

See anything suspicious?  


On Thu, Jan 10, 2013 at 5:04 PM, Olivier NOUGUIER <olivier.nouguier@xxxxxxxxx> wrote:
No real idea about the goalPrefix impact, but I would be surprised. The simplest reason I can imagine is that the "secondaryTo" configurator (org.maven.ide.eclipse.configuration.wtp.configurator)is not present.
What do you have in the maven console, when (maven) updating the project?


On Thu, Jan 10, 2013 at 9:46 AM, Greg Amerson <gregory.amerson@xxxxxxxxxxx> wrote:
Hi Olivier,

Your right, that extra lifecycleMapping extension point in my plugin.xml was just my attempt at trying to debug this and get things work.  I removed that extention, so now my plugin.xml only looks like this:

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

   <extension
         point="org.eclipse.m2e.core.projectConfigurators">
      <configurator
            class="com.liferay.ide.maven.core.LiferayProjectConfigurator"
            id="com.liferay.ide.maven.core.project.configurator"
            name="Liferay Project Configurator"
            secondaryTo="org.maven.ide.eclipse.configuration.wtp.configurator">
      </configurator>
   </extension>
</plugin>


And my lifecycle-mapping-metadata.xml looks like this:

<lifecycleMappingMetadata>
    <pluginExecutions>
        <pluginExecution>
            <pluginExecutionFilter>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <versionRange>[2.0.1,)</versionRange>
                <goals>
                    <goal>war</goal>
                </goals>
            </pluginExecutionFilter>
            <action>
                <configurator>
                    <id>com.liferay.ide.maven.core.project.configurator</id>
                </configurator>
            </action>
        </pluginExecution>
        <pluginExecution>
            <pluginExecutionFilter>
                <groupId>com.liferay.maven.plugins</groupId>
                <artifactId>liferay-maven-plugin</artifactId>
                <versionRange>[6.0.0,)</versionRange>
                <goals>
                    <goal>build-css</goal>
                    <goal>build-ext</goal>
                    <goal>build-thumbnail</goal>
                    <goal>theme-merge</goal>
                </goals>
            </pluginExecutionFilter>
            <action>
                <configurator>
                    <id>com.liferay.ide.maven.core.project.configurator</id>
                </configurator>
            </action>
        </pluginExecution>
    </pluginExecutions>
</lifecycleMappingMetadata>


But still no luck.  Is there any chance that its the use of <goalPrefix> by the Liferay Maven Plugin?


On Thu, Jan 10, 2013 at 4:36 PM, Olivier NOUGUIER <olivier.nouguier@xxxxxxxxx> wrote:
Hi Greg,
  Are you sure that you need to add a "lifecycleMappings" ? You seem to rely on a "vanilla" war packaging ... so this might be a problem to map your own lifecyle .
HIH



On Thu, Jan 10, 2013 at 8:40 AM, Greg Amerson <gregory.amerson@xxxxxxxxxxx> wrote:
Hello m2e developer, 

I'm trying to write a plugin for Eclipse that will include the lifecycle-mapping-metadata for a Maven plugin for Liferay development: com.liferay.maven.plugins:liferay-maven-plugin

This maven plugin for Liferay defines several custom goals that are all prefixed by liferay, e.g:
liferay:build-css
liferay:build-ext
liferay:build-thumbnail
liferay:theme-merge

All Liferay maven plugins use package type war, When I try to import a project using m2e (and m2e-wtp is used as well since all liferay maven plugins use packagingType:war), I have plugin executions not covered (see attached screenshot).

So I'm trying to add a new plugin to Liferay IDE (bunch of liferay related eclipse plugins) that will handle the m2e plugin execution lifecycle mapping for these 4 custom liferay goals that exist on "war" packages.  You can see my attempt here:


And to see the lifecycle-mapping-metadata.xml it is here:

However, when I run this in my dev environment, m2e import wizard still complains with the same error about those executions not being covered (see attached screenshot).  I have debugged many times through m2e core's lifecycle mapping detection code and I have confirmed it is reading my metadata.xml file, but for some reason it is not matching those executions on the project import.  

Here is the source to the project that I'm trying to import that is giving me the errors in the import wizard so you can see for reference:


Any help would be appreciated to see what I'm missing as why my m2e-extension plugin is not doing what it needs to get these custom goals properly recognized as configured.  Thanks for anyone taking time to help out.

--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

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




--
"Computers are useless. They can only give you answers."
- Pablo Picasso -

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




--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

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




--
"Computers are useless. They can only give you answers."
- Pablo Picasso -

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




--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

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




--
"Computers are useless. They can only give you answers."
- Pablo Picasso -

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




--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

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




--
"Have you tried turning it off and on again" - The IT Crowd
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev




--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

Back to the top