[ 
https://issues.apache.org/jira/browse/MENFORCER-320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16639840#comment-16639840
 ] 

ASF GitHub Bot commented on MENFORCER-320:
------------------------------------------

vovkss opened a new pull request #42: MENFORCER-320 RequireProfileIdsExist 
check must not fail if no profiles are used
URL: https://github.com/apache/maven-enforcer/pull/42
 
 
   Fixes RequireProfileIdsExist behavior if there are no profiles on the 
command line nor in the pom.xml. Fixes breadcrumbs on the plugin's site for the 
RequireProfileIdsExist rule page.
   
   I hereby declare this contribution to be licenced under the [Apache License 
Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   

----------------------------------------------------------------
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)

Reply via email to