Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] Uninteresting lifecycle phases are built???

Mmm...

I understand what you are saying but it makes no sense.

This behavior exists even when the plugin contains "lifecycle-mapping-metadata.xml".

Are you saying that all plugins will have this behavior? See my original post.

I noticed this with the frontend-maven-plugin which contains the appropriate mapping file.

But I don't expect the phase test to be executed every time, specially not on configuration and incremental.

The reason I noticed is because of the length of building an angular project.


The explicit org.eclipse.m2e:lifecycle-mapping plugin should not impact the behavior of which phases are interesting for m2e. It's analogous to the file. Furthermore, if I remove my mapping the ant plugin will fail with "Plugin execution not covered by lifecycle configuration".


-

p


On 2019-03-18 3:41 p.m., Matthew Piggott wrote:
Yes, I understand that. I'm pointing out that your mapping overrides m2e's default decision that the phase is uninteresting.

Try commenting out the mapping in your pom and notice it considers that execution as uninteresting. (May require you to update your project)

On Mon, 18 Mar 2019 at 15:34, Pino Silvaggio <pino.silvaggio@xxxxxxxxx> wrote:

Yes, the goals, yes.

I am talking about the phase.

M2E should handle some phases as described: https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html

To solve these long-standing issues, M2Eclipse 1.0 requires explicit instructions what to do with all Maven plugins bound to “interesting” phases (see [M2E interesting lifecycle phases](M2E interesting lifecycle phases “wikilink”)) of a project build lifecycle. We call these instructions “project build lifecycle mapping” or simply “lifecycle mapping” because they define how m2e maps information from project pom.xml file to Eclipse workspace project configuration and behaviour during Eclipse workspace build.

Also, see https://github.com/eclipse/m2e-core/blob/master/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java

If I am mistaken, then, the current behavior is inconsistent since sometimes only the "interesting" phases, as seen defined in lifecyclemapping/LifecycleMappingFactory.java (INTERESTING_PHASES), are executed.

-

p


On 2019-03-18 3:08 p.m., Matthew Piggott wrote:
The lifecycle mapping specifies that the run goal should be run.

In Eclipse if you open the project's properties from the context menu, under Maven there is a Lifecycle Mapping page which shows the various plugin executions.

On Mon, 18 Mar 2019 at 10:21, Pino Silvaggio <pino.silvaggio@xxxxxxxxx> wrote:
Mmm... I don't believe this is the case. How does it override the mapping? All plugins exhibits this behavior. Anyhow, to my knowledge there is no way to map to a phase.

In any case, m2e should only execute the 'interesting' phases with no exceptions. 


On March 18, 2019 09:34:29 Matthew Piggott <mpiggott@xxxxxxxxxxxx> wrote:

The lifecycle mapping is overriding it.

On Sat, 16 Mar 2019 at 16:57, Pino Silvaggio <pino.silvaggio@xxxxxxxxx> wrote:

Well,

frontend-maven-plugin has the lifecycle-mapping-metadata.xml but to emulate the problem

For example, the test phase should not be taken into account by m2e but it is. You can see it fail on configuration and incremental build.

<?xml version="1.0" encoding="UTF-8"?>

<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.bitstrings.m2e</groupId>
    <artifactId>m2e-lifecycle-test</artifactId>
    <version>1.0.0-SNAPSHOT</version>

    <packaging>jar</packaging>

    <build>
        <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-antrun-plugin</artifactId>
                                        <versionRange>[0.0.0,)</versionRange>
                                        <goals>
                                            <goal>run</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute>
                                            <runOnConfiguration>true</runOnConfiguration>
                                            <runOnIncremental>true</runOnIncremental>
                                        </execute>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <echo>COMPILE EXECUTED!</echo>
                            </tasks>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <echo>SHOULD NOT BE EXECUTED!</echo>
                                <fail />
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>           
        </plugins>
    </build>

</project>




On 2019-03-16 1:19 a.m., Fred Bricon wrote:
That sounds wrong. Do you have a sample project reproducing this behavior?

On Sat, Mar 16, 2019 at 12:36 AM Pino Silvaggio <pino.silvaggio@xxxxxxxxx> wrote:

Hello people,

I have a situation where I use the "frontend-maven-plugin" (https://github.com/eirslett/frontend-maven-plugin)
and it's binded on different phases depending on the work to be done.

For example, yarn build is on the compile phase and yarn test is on the test phase.

But this is where it gets weird. The yarn test is executed by the m2e in MavenBuilderImpl ???

It takes a very long time since it runs all the unit tests.

Why? This is not an interesting phase for m2e. Furthermore, I have noticed it runs other uninteresting phases
like package,install and deploy.

Can someone explain to me how this is a good behavior?


_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/m2e-dev


--
"Have you tried turning it off and on again" - The IT Crowd
And if that fails, then http://goo.gl/tnBgH5

_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/m2e-dev
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/m2e-dev


--
Sonatype
Matthew Piggott
Java Developer

_______________________________________________
m2e-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit



--
Sonatype
Matthew Piggott
Java Developer



--
Sonatype
Matthew Piggott
Java Developer


Back to the top