You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Gene Smith (Jira)" <ji...@apache.org> on 2021/08/02 17:02:00 UTC
[jira] [Comment Edited] (MENFORCER-364) requireFilesExist rule
should be case sensitive
[ https://issues.apache.org/jira/browse/MENFORCER-364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17391701#comment-17391701 ]
Gene Smith edited comment on MENFORCER-364 at 8/2/21, 5:01 PM:
---------------------------------------------------------------
The change can break the test for paths with ".." or "." in them.:
* C:\hello\..\world\
* C:\some\path\workspace\code-project\..\resource-project\blah\
* ${basedir}\..\resource-project\
Whether or not it does seems to depend on maven versions and other things.
I don't love the paths, but a project support uses them. I will probably work around it
for my projects by writing a custom rule, rather than wait for a fix.
...
And it would have saved me an hour if the log said it was a case sensitivity match that failed.
I had to dig into the source code of the plugin to figure out why it was saying a path did not
exist when I could see and test the file.
was (Author: gene):
The change can breaks for absolute paths with ".." or "." in them.:
* C:\hello\..\world\
* C:\some\path\workspace\code-project\..\resource-project\blah\
* ${basedir}\..\resource-project\
Whether or not it does seems to depend on maven versions and other things.
I don't love the paths, but a project support uses them. I will probably work around it
for my projects by writing a custom rule, rather than wait for a fix.
...
And it would have saved me an hour if the log said it was a case sensitivity match that failed.
I had to dig into the source code of the plugin to figure out why it was saying a path did not
exist when I could see and test the file.
> requireFilesExist rule should be case sensitive
> -----------------------------------------------
>
> Key: MENFORCER-364
> URL: https://issues.apache.org/jira/browse/MENFORCER-364
> Project: Maven Enforcer Plugin
> Issue Type: Bug
> Affects Versions: 3.0.0-M3
> Reporter: Johannes Goebel
> Assignee: Robert Scholte
> Priority: Minor
> Fix For: 3.0.0
>
>
> When using the enforcer plugin with a configuration using the {{requireFilesExist}} rule, as follows, the case of the existence of files cannot be enforced case sensitive.
> {code:xml}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-enforcer-plugin</artifactId>
> <version>3.0.0-M3</version>
> <executions>
> <execution>
> <id>enforce-files-exist</id>
> <goals>
> <goal>enforce</goal>
> </goals>
> <configuration>
> <rules>
> <requireFilesExist>
> <files>
> <file>src/main/resources/i18n_de.properties</file>
> </files>
> </requireFilesExist>
> </rules>
> <fail>true</fail>
> </configuration>
> </execution>
> </executions>
> </plugin>
> {code}
> For example, if the file {{src/main/resources/i18n_DE.properties}} exists, but not {{src/main/resources/i18n_de.properties}} the execution of the plugin will succeed.
> Unfortunately in my use case, this is exactly the requirement. I have not found a way to enforce case sensitivity for this rule.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)