Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appending plugin more than once should add new execution to existing plugin in build section #53

Closed
maxonfjvipon opened this issue Apr 25, 2024 · 4 comments

Comments

@maxonfjvipon
Copy link

I want to use the same plugin on different phases. Here's the pom.xml I'd like to have:

<build>
  <plugins>
    <plugin>
      <groupId>org.eolang</groupId>
      <artifactId>eo-maven-plugin</artifactId>
      <executions>
        <execution>
          <phase>first</phase>
          <goals>
             ...
          </goals
        </execution>
        <execution>
          <phase>second</phase>
          <goals>
            ...
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

But by using Farea API like this:

f.build()
    .plugins()
    .append(
        "org.eolang",
        "eo-maven-plugin",
        System.getProperty("eo.version", "1.0-SNAPSHOT")
    )
    ...
f.build()
    .plugins()
    .append(
        "org.eolang",
        "eo-maven-plugin",
        System.getProperty("eo.version", "1.0-SNAPSHOT")
    )
    ...

I get 2 plugins instead of 2 executions which does not work because the second one rewrites the first one

<build>
  <plugins>
    <plugin>
      <groupId>org.eolang</groupId>
      <artifactId>eo-maven-plugin</artifactId>
      <executions>
        <execution>
          <phase>first</phase>
          <goals>
             ...
          </goals
        </execution>
      </executions>
    </plugin>
    <plugin>
      <groupId>org.eolang</groupId>
      <artifactId>eo-maven-plugin</artifactId>
      <executions>
        <execution>
          <phase>second</phase>
          <goals>
             ...
          </goals>
      </executions>
    </plugin>
  </plugins>
</build>
@maxonfjvipon maxonfjvipon changed the title Appending plugin more than once should add new execution to existing plugin Appending plugin more than once should add new execution to existing plugin in build section Apr 25, 2024
yegor256 added a commit that referenced this issue Apr 25, 2024
yegor256 added a commit that referenced this issue Apr 25, 2024
yegor256 added a commit that referenced this issue Apr 25, 2024
@yegor256
Copy link
Owner

@rultor release, tag is 0.0.15

@rultor
Copy link
Collaborator

rultor commented Apr 25, 2024

@rultor release, tag is 0.0.15

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Collaborator

rultor commented Apr 25, 2024

@rultor release, tag is 0.0.15

@yegor256 Done! FYI, the full log is here (took me 11min)

@yegor256
Copy link
Owner

@maxonfjvipon should work now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants