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

Would be nice to have filtering of some configuration for special chracters #208

Open
GregDomjan opened this issue Feb 17, 2016 · 3 comments

Comments

@GregDomjan
Copy link
Member

Plugin passes defines/options etc. through without filtering for special characters

For instance windows resource compiler can have issue with newline.

<define>visibly bad
if you look</define>
<define>${artifact.description} might be broken, depends on description</define>

For newline resource compile resulting in

  • process hang
  • errors from like
    error RC2001: newline in constant

This came up several times for us as auto formatting of the pom.xml adding newlines.

Would be nice to have option to filter characters and give replacement values, like
replace return\newline with \r\n
strip return\newline

@ctrueden
Copy link
Contributor

Was this only an issue with NAR for you? Or did it affect other aspects of your Maven builds, too?

If the filtering is specified using Maven properties, then there is a bit of a catch-22, no? Would it suffice to simply filter all known-problematic characters such as newlines?

@GregDomjan
Copy link
Member Author

Originally (maybe back in 2.) it was a real problem with a hang that required accessing a build vm to kill tasks, now it is reporting the error and failing so at least build slaves don't become locked and the error information can be tracked back and addressed. In that regard this is a "nice to have" what do others think.

For NAR it is specifically the defines.

You can't do the following for instance in code

#define a split
string like this

You could make it one string with the multi line continuation\join

#define a split \
string like this

Or make it one string that includes a newline

#define a split \nstring like this

If you where to use maven-resources-plugin filtering to substitute some value into a file then you would end up with the similar issue.
I think that is not unreasonable as it lacks context.
The plugin offers one filter of the input properties 'escapeWindowsPaths'

I have a similar issue with NPanday and it's generation of AssemblyInfo.cs
[INFO] | target\build-sources\META-INF\com\AssemblyInfo.cs(3,32): error CS1010: Newline in constant

NAR & NPanday have some knowledge about limitations of a define that could be applied, I think that this additional processing would be after Maven substitution of properties and setting the defines list and so would not be a catch-22 situation.

It would probably be sufficient to simply filter\strip known problem characters such as the newline or carriage return.

@ctrueden ctrueden added this to the unscheduled milestone Apr 26, 2016
@ctrueden
Copy link
Contributor

Adding to unscheduled for now. But in principle I see no issues with filtering configuration. Sounds like it would prevent some annoyances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants