[
https://issues.apache.org/jira/browse/MENFORCER-320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16639883#comment-16639883
]
ASF GitHub Bot commented on MENFORCER-320:
------------------------------------------
khmarbaise commented on issue #42: MENFORCER-320 RequireProfileIdsExist check
must not fail if no profiles are used
URL: https://github.com/apache/maven-enforcer/pull/42#issuecomment-427384154
Good catch. There are two things. First would you please create at least on
integration test which proves the fix and second please squash your commits
into a single one...furthermore please make your commit message look like this:
```
[MENFORCER-320] - Subject of the ticket
Optional supplemental explanations
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> RequireProfileIdsExist check fails if no profiles have been specified
> ---------------------------------------------------------------------
>
> Key: MENFORCER-320
> URL: https://issues.apache.org/jira/browse/MENFORCER-320
> Project: Maven Enforcer Plugin
> Issue Type: Bug
> Components: Standard Rules
> Affects Versions: 3.0.0-M2
> Reporter: Alex Shesterov
> Priority: Major
>
> The {{RequireProfileIdsExist}} rule introduced by MENFORCER-282 fails if
> Maven is invoked without any active profiles and no profiles are defined in
> the {{pom.xml}} itself.
> This particularly applies to multi-module projects where all the profiles are
> defined in the parent pom — there's no way to build a single module
> separately in this case.
> An example which demonstrates the problem:
> {code:java|title=pom.xml}
> <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/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>com.example</groupId>
> <artifactId>parent</artifactId>
> <version>1.0.0-SNAPSHOT</version>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-enforcer-plugin</artifactId>
> <version>3.0.0-M2</version>
> <executions>
> <execution>
> <goals>
> <goal>enforce</goal>
> </goals>
> <configuration>
> <rules>
> <requireProfileIdsExist/>
> </rules>
> </configuration>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
> </project>
> {code}
> {code:java|title=terminal}
> $mvn validate
> [INFO] Scanning for projects...
> [INFO]
> [INFO] -------------------------< com.example:parent
> >-------------------------
> [INFO] Building parent 1.0.0-SNAPSHOT
> [INFO] --------------------------------[ jar
> ]---------------------------------
> [INFO]
> [INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (default) @ parent ---
> [WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireProfileIdsExist
> failed with message:
> The requested profile doesn't exist:
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 0.563 s
> [INFO] Finished at: 2018-10-05T14:00:35+02:00
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M2:enforce (default) on
> project parent: Some Enforcer rules have failed. Look above for specific
> messages explaining why the rule failed. -> [Help 1]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions, please
> read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
> {code}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)