Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6498

Order plugin execution changes depending on profile activation method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Not A Problem
    • 3.3.9, 3.5.2
    • None
    • Profiles
    • None

    Description

      In a project with parent child relationship (and spring boot maven plugin) I can observe that the order of execution of same phase plugins (boot maven plugin and spotify docker plugin, both of which activate in the package phase) is not preserved if profile is activated with the file exists.

       

      As an example, the spring boot maven plugin left in the default build / pluginManagement section will not be activated if I add a profile like the following:

       

      <profiles>
          <profile>
            <id>local-docker-image</id>
            <activation>
              <activeByDefault>false</activeByDefault>
              <file>
                <exists>${basedir}/src/main/docker/Dockerfile</exists>
              </file>
            </activation>
            <build>
              <plugins>
                <plugin>
                 <groupId>com.spotify</groupId>
                  <artifactId>docker-maven-plugin</artifactId>
                  <version>${docker.maven.plugin.version}</version>
                  <executions>
                    <execution>
                      <id>build-image</id>
                      <phase>package</phase>
                      <goals>
                        <goal>build</goal>
      

       The docker plugin will file trying to find the artifact jar (which gets renamed from the boot maven plugin, because the execution order is 

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            lucabotti Luca Botti
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: