Skip to content

Conversation

@Khwaj7
Copy link

@Khwaj7 Khwaj7 commented Nov 13, 2025

Refactor README to move the configuration to the correct place

Thanks for this useful project!

Summary

I tried setting the tag in the part, but this part only accepts children.

I think the should be in the corresponding , except if it's common to multiple so we can set it as a child of tag.

Tests and Documentation

Here is my working pom:

<plugin>
      <groupId>com.github.eirslett</groupId>
      <artifactId>frontend-maven-plugin</artifactId>
      <version>1.15.4</version>
      <executions>
            <execution>
                  <id>install-node-and-corepack</id>
                  <goals>
                        <goal>install-node-and-corepack</goal>
                        <goal>yarn</goal>
                  </goals>
                  <!-- optional: default phase is "generate-resources" -->
                  <phase>generate-resources</phase>
                  <configuration>
                        <arguments>-v</arguments>
                        <nodeVersion>v22.4.1</nodeVersion>
                        <corepackVersion>v0.34.3</corepackVersion>
                        <yarnVersion>v4.11.0</yarnVersion>
                  </configuration>
            </execution>
      </executions>
</plugin>

Here is the pom if I follow the actual README. It generates an error as the tag can't be placed here:

<plugin>
    <execution>
        <id>install-node-and-corepack</id>
        <goals>
            <goal>install-node-and-corepack</goal>
        </goals>
    </execution>
    <configuration>
        <nodeVersion>v20.12.2</nodeVersion>

        <!-- Optional - only needed if Node <16.9, or if you need to use a version different
             from the one packaged with Node -->
        <corepackVersion>v0.25.2</corepackVersion>

        <!-- optional: where to download node from. Defaults to https://nodejs.org/dist/ -->
        <nodeDownloadRoot>http://myproxy.example.org/nodejs/</nodeDownloadRoot>
        <!-- optional: where to download corepack from. Defaults to https://registry.npmjs.org/corepack/-/ -->
        <corepackDownloadRoot>http://myproxy.example.org/corepack/</corepackDownloadRoot>
    </configuration>
</plugin>

Refactor README to move the configuration to the correct place
@eirslett
Copy link
Owner

I think the example is wrong in the sense that it's lacking <executions> outside of <execution>?
The point of keeping the configuration outside, is that if you have several executions of the plugin, they should all share the same node/npm whatever common configuration!

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

Successfully merging this pull request may close these issues.

2 participants