You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Christopher Tubbs (JIRA)" <ji...@codehaus.org> on 2014/04/10 19:32:11 UTC

[jira] (MNG-5478) Order of plugin execution does not match order of definition in profile

    [ https://jira.codehaus.org/browse/MNG-5478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=344680#comment-344680 ] 

Christopher Tubbs commented on MNG-5478:
----------------------------------------

Okay, I was definitely able to verify that it still executes out of order, at least with the maven-release-plugin executing items in a profile. The problem seems to happen with 3.0.4, 3.1.1, and 3.2.1. The following is the relevant section of my POM:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<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>
  <parent>
    <groupId>org.apache.accumulo</groupId>
    <artifactId>accumulo-project</artifactId>
    <version>1.6.0</version>
  </parent>
  <artifactId>accumulo-docs</artifactId>
  <packaging>pom</packaging>
  <name>Documentation</name>
  <description>User documentation for Apache Accumulo.</description>
  <profiles>
    <profile>
      <id>docs</id>
      <dependencies>
        <dependency>
          <groupId>org.apache.accumulo</groupId>
          <artifactId>accumulo-core</artifactId>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>prep-output-dir</id>
                <goals>
                  <goal>exec</goal>
                </goals>
                <phase>compile</phase>
                <configuration>
                  <executable>mkdir</executable>
                  <arguments>
                    <argument>-p</argument>
                    <argument>${project.build.directory}/latex/accumulo_user_manual/appendices</argument>
                  </arguments>
                </configuration>
              </execution>
              <execution>
                <id>config-html</id>
                <goals>
                  <goal>java</goal>
                </goals>
                <phase>compile</phase>
                <configuration>
                  <mainClass>org.apache.accumulo.core.conf.DefaultConfiguration</mainClass>
                  <classpathScope>compile</classpathScope>
                  <arguments>
                    <argument>--generate-html</argument>
                    <argument>${project.build.directory}/config.html</argument>
                  </arguments>
                </configuration>
              </execution>
              <execution>
                <id>config-appendix</id>
                <goals>
                  <goal>java</goal>
                </goals>
                <phase>compile</phase>
                <configuration>
                  <mainClass>org.apache.accumulo.core.conf.DefaultConfiguration</mainClass>
                  <classpathScope>compile</classpathScope>
                  <arguments>
                    <argument>--generate-latex</argument>
                    <argument>${project.build.directory}/latex/accumulo_user_manual/appendices/config.tex</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>latex-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>build-pdf-manuals</id>
                <goals>
                  <goal>latex</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-user-manual-pdf</id>
                <goals>
                  <goal>attach-artifact</goal>
                </goals>
                <configuration>
                  <artifacts>
                    <artifact>
                      <file>${project.build.directory}/accumulo_user_manual.pdf</file>
                      <type>pdf</type>
                      <classifier>user-manual</classifier>
                    </artifact>
                  </artifacts>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
{code}

And this is the relevant debug output:
{code}
[INFO] [DEBUG] -----------------------------------------------------------------------
[INFO] [DEBUG] Goal:          org.codehaus.mojo:latex-maven-plugin:1.1:latex (build-pdf-manuals)
[INFO] [DEBUG] Style:         Regular
[INFO] [DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
[INFO] <configuration>
[INFO]   <binariesPath default-value="">${latex.binariesPath}</binariesPath>
[INFO]   <buildDir>${project.build.directory}</buildDir>
[INFO]   <commonsDirName default-value="common">${latex.commonsDirName}</commonsDirName>
[INFO]   <docsRoot default-value="src/main/latex">${latex.docsRoot}</docsRoot>
[INFO]   <latexBuildDir default-value="${project.build.directory}/latex">${project.latex.build.directory}</latexBuildDir>
[INFO] </configuration>
[INFO] [DEBUG] -----------------------------------------------------------------------
[INFO] [DEBUG] Goal:          org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (prep-output-dir)
[INFO] [DEBUG] Style:         Regular
[INFO] [DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
[INFO] <configuration>
[INFO]   <arguments>
[INFO]     <argument>-p</argument>
[INFO]     <argument>/local/cltubbs/git/apache/accumulo/docs/target/latex/accumulo_user_manual/appendices</argument>
[INFO]   </arguments>
[INFO]   <basedir default-value="${basedir}"/>
[INFO]   <classpathScope default-value="runtime">${exec.classpathScope}</classpathScope>
[INFO]   <commandlineArgs>${exec.args}</commandlineArgs>
[INFO]   <executable>mkdir</executable>
[INFO]   <longClasspath default-value="false">${exec.longClasspath}</longClasspath>
[INFO]   <outputFile>${exec.outputFile}</outputFile>
[INFO]   <project default-value="${project}"/>
[INFO]   <session default-value="${session}"/>
[INFO]   <skip default-value="false">${skip}</skip>
[INFO]   <sourceRoot>${sourceRoot}</sourceRoot>
[INFO]   <testSourceRoot>${testSourceRoot}</testSourceRoot>
[INFO]   <workingDirectory>${exec.workingdir}</workingDirectory>
[INFO] </configuration>
[INFO] [DEBUG] --- init fork of org.apache.accumulo:accumulo-docs:1.6.0 for org.codehaus.mojo:exec-maven-plugin:1.2.1:java (config-html) ---
[INFO] [DEBUG] Dependencies (collect): []
[INFO] [DEBUG] Dependencies (resolve): [test]
[INFO] [DEBUG] -----------------------------------------------------------------------
[INFO] [DEBUG] Goal:          com.google.code.sortpom:maven-sortpom-plugin:2.3.0:verify (verify-sorted-pom)
[INFO] [DEBUG] Style:         Regular
[INFO] [DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
[INFO] <configuration>
[INFO]   <backupFileExtension default-value=".bak">${sort.backupFileExtension}</backupFileExtension>
[INFO]   <createBackupFile default-value="true">${sort.createBackupFile}</createBackupFile>
[INFO]   <encoding default-value="UTF-8">${sort.encoding}</encoding>
{code}

Note: the latex-maven-plugin binds to the compile phase by default, and the project builds fine with verify, but not with the release:prepare (with preparationGoals set to verify). When I explicitly set the phase to compile, it still doesn't work, but a later phase does.

> Order of plugin execution does not match order of definition in profile
> -----------------------------------------------------------------------
>
>                 Key: MNG-5478
>                 URL: https://jira.codehaus.org/browse/MNG-5478
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Plugins and Lifecycle, Profiles
>    Affects Versions: 3.0.5
>         Environment: Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 08:51:28-0500)
> Maven home: /usr/local/Cellar/maven/3.0.5/libexec
> Java version: 1.7.0_21, vendor: Oracle Corporation
> Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "mac os x", version: "10.7.5", arch: "x86_64", family: "mac"
>            Reporter: Martin Burger
>
> I would like to create an assembly that contains an obfuscated all-in-one version of the main JAR artifacts of a multi-module project. For this purpose, I created a profile that binds the following plugins and goals, respectively, to phase {{package}}:
> # {{maven-shade-plugin:shade}} - creates a single JAR file that contains all classes of all modules (basically, an uberjar that, however, does not contain 3rd-party libraries)
> # {{proguard-maven-plugin:proguard}} - creates an obfuscated version of the above JAR file
> # {{maven-assembly-plugin:single}} - creates a single distributable archive that contains the above obfuscated JAR file alongside of 3rd-party JAR files and some CLI scripts
> Having the above configuration, it should be sufficient to call {{maven package}} in order to create the desired assembly.
> However, the plugins are not executed in the above order but the ProGuard plugin gets executed first which consequently complains about the missing input file (the latter should be created by the Shade plugin).
> As a workaround, I created a profile that only binds the first two plugins to phase {{package}}. Furthermore, I first call {{mvn package}} to create the obfuscated "uberjar"; only then, I call {{mvn assembly:single}} to create the desired assembly file.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)