github / maven-plugins

Official GitHub Maven Plugins
MIT License
584 stars 198 forks source link

Maven-execution-plugin is not running when its enclosed in in pluginmanagement of pom.xml #125

Open navakrishna opened 7 years ago

navakrishna commented 7 years ago

Maven execution plugin is failing for below configuration if i enclose this plugin in pluginmanagement tag. How pluginmanagement works? Plugins execution works with and without pluginmanagement configuration. What is the difference in the execution if we use or don't?

org.codehaus.mojo exec-maven-plugin exec-npm-install generate-sources cmd ${project.basedir}/src/main/webapp/ngapp /c npm install exec exec-gulp generate-sources cmd ${project.basedir}/src/main/webapp/ngapp /c gulp build-all-prod exec
        **</pluginmanagement>**
erijonhson commented 5 years ago

Also with me:

<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <!-- ... ... --> 

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>
  </properties>

  <repositories>
    <repository>
      <id>in-project</id>
      <name>In Project Repo</name>
      <url>file://${project.basedir}/lib</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>jflex</groupId>
      <artifactId>jflex</artifactId>
      <version>1.6.1</version>
    </dependency>
    <dependency>
      <groupId>cup</groupId>
      <artifactId>java-cup</artifactId>
      <version>11b</version>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.2.1</version>
          <executions>
            <execution>
              <id>create-lexer</id>
              <phase>validate</phase>
              <configuration>
                <executable>java</executable>
                <workingDirectory>${project.basedir}/src/main/java/br/edu/ufcg/ccc</workingDirectory>
                <arguments>
                  <argument>-jar</argument>
                  <argument>${project.basedir}/lib/jflex/jflex/1.6.1/jflex-1.6.1.jar</argument>
                  <argument>-d</argument>
                  <argument>${project.basedir}/src/main/java/br/edu/ufcg/ccc</argument>
                  <argument>${project.basedir}/src/main/java/go.flex</argument>
                </arguments>
              </configuration>
              <goals>
                <goal>exec</goal>
              </goals>
            </execution>
            <execution>
              <id>create-parser-and-sym</id>
              <phase>validate</phase>
              <configuration>
                <executable>java</executable>
                <workingDirectory>${project.basedir}/src/main/java/br/edu/ufcg/ccc</workingDirectory>
                <arguments>
                  <argument>-jar</argument>
                  <argument>${project.basedir}/lib/cup/java-cup/11b/java-cup-11b.jar</argument>
                  <argument>-parser</argument>
                  <argument>Parser</argument>
                  <argument>-interface</argument>
                  <argument>-symbols</argument>
                  <argument>sym</argument>
                  <argument>${project.basedir}/src/main/java/go.cup</argument>
                </arguments>
              </configuration>
              <goals>
                <goal>exec</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

</project>

Just remove </pluginManagement> that works again, although it shows error in the pom.

erijonhson commented 5 years ago

https://www.genuitec.com/forums/topic/pom-error-plugin-execution-not-covered-by-lifecycle/

jeacott1 commented 4 years ago

its not supposed to. pluginManagement is a template for actual plugin definitions.