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

Add skipIfMissing flag #187

Merged
merged 5 commits into from
Nov 21, 2023
Merged

Conversation

hgschmie
Copy link
Contributor

@hgschmie hgschmie commented Sep 2, 2023

  • build-helper:add-source
  • build-helper:add-test-source
  • build-helper:add-resource
  • build-helper:add-test-resource

add flag <skipIfMissing>true|false<skipIfMissing>. If this flag is set
to true and a directory that should be added does not exist, skip it and
do not add it to the build. This allows a multi module build to use
these plugins unconditionally. E.g.

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>kotlin</id>
            <goals>
                <goal>add-source</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
                <skipIfMissing>true</skipIfMissing>
                <sources>
                    <source>${project.basedir}/src/main/kotlin</source>
                </sources>
            </configuration>
        </execution>
    </executions>
</plugin>

can be configured unconditionally and only modules that actually have a
src/main/kotlin folder will add this as a compile root.

@slawekjaranowski
Copy link
Member

please add tests for new parameters

@hgschmie
Copy link
Contributor Author

hgschmie commented Sep 3, 2023

please add tests for new parameters

Sure, but what is the point, given this:

[ERROR] The following builds failed:
[ERROR] *  released-version/pom.xml
[ERROR] *  reserve-ports/pom.xml
[ERROR] *  reserve-ports-with-urls/pom.xml
[ERROR] *  released-version-existing-asset-issue-108/pom.xml
[ERROR] *  reserve-ports-with-min-root-range/pom.xml
[ERROR] *  released-version-existing-asset/pom.xml
[ERROR] *  reserve-ports-with-min/pom.xml

@slawekjaranowski
Copy link
Member

please add tests for new parameters

Sure, but what is the point, given this:

[ERROR] The following builds failed:
[ERROR] *  released-version/pom.xml
[ERROR] *  reserve-ports/pom.xml
[ERROR] *  reserve-ports-with-urls/pom.xml
[ERROR] *  released-version-existing-asset-issue-108/pom.xml
[ERROR] *  reserve-ports-with-min-root-range/pom.xml
[ERROR] *  released-version-existing-asset/pom.xml
[ERROR] *  reserve-ports-with-min/pom.xml

fixed in #188 - thanks @hgschmie for point it

@slawekjaranowski slawekjaranowski mentioned this pull request Sep 4, 2023
@slawekjaranowski slawekjaranowski self-assigned this Sep 20, 2023
- build-helper:add-source
- build-helper:add-test-source
- build-helper:add-resource
- build-helper:add-test-resource

add flag `<skipIfMissing>true|false<skipIfMissing>`. If this flag is set
to true and a directory that should be added does not exist, skip it and
do not add it to the build. This allows a multi module build to use
these plugins unconditionally. E.g.

```
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>kotlin</id>
            <goals>
                <goal>add-source</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
                <skipIfMissing>true</skipIfMissing>
                <sources>
                    <source>${project.basedir}/src/main/kotlin</source>
                </sources>
            </configuration>
        </execution>
    </executions>
</plugin>
```

can be configured unconditionally and only modules that actually have a
`src/main/kotlin` folder will add this as a compile root.
Align with other plugins, use buildhelper prefix and plugin name.
@slawekjaranowski slawekjaranowski merged commit ad1076e into mojohaus:master Nov 21, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants