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

plugin 1.5.5 uses platform encoding for filtering resources #305

Closed
ecki opened this issue Aug 9, 2017 · 4 comments
Closed

plugin 1.5.5 uses platform encoding for filtering resources #305

ecki opened this issue Aug 9, 2017 · 4 comments
Labels
Milestone

Comments

@ecki
Copy link

ecki commented Aug 9, 2017

Since 1.5.5 (as opposed to 1.5.3) the process-asciidoc goal will also copy (filtered) resources. It prints:

[INFO] --- asciidoctor-maven-plugin:1.5.5:process-asciidoc (asciidoc-to-pdf) @ troubleshooting-manual ---
[DEBUG]   (s) resources = []
[DEBUG] properties used {...project.build.sourceEncoding=UTF-8}
[INFO] Using 'Cp1252' encoding to copy filtered resources.
[INFO] ignoreDelta true
[INFO] Copying 0 resource
[INFO] Rendered d:\....adoc

Where Cp1252 is my (Windows) platform encoding but not the encoding I have configured for the POM via <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> (debug output confirms it is set).

I guess it is not that critical as most of those resources are not filtered anyway, but it does look like it is missing to define and propagate a <encoding> configuration (to resource copy as well as potential asciidoc file encoding?).

Env: Maven 3.5.0 on Windows 10 x64 german with Java 1.8.0_141 with explicite asciidoctorj 1.5.6 and jruby 9.1.8.0.

@abelsromero
Copy link
Member

good catch! I created a PR to capture the property #306

Note that resources are just copied, filtering is disabled.
Thing is we use Maven Filtering under-the-hood to copy the resources because it allows for some nice options (see section in the README). The API does not allow to separate the copy logic from the filtering one, so we disable the filtering. But still, it prints those message.
Back then I tried to disable them, but could not find how, let me have a look again, and maybe I can disable them.

@abelsromero
Copy link
Member

Really, haven't been able to find anything to disable the messages, the code is pretty straight forward, nothing weird, no config files, nothing... Also modifying the logger is not possible and I don't like it anyway.
I checked the code of the maven-resource-plugin and there's nothing there either, but the plugin does show much less messages in the console and uses the same API we do (head spinning here).

After all of this, I have sent a message to the mailing list, let's see how it goes.

@abelsromero
Copy link
Member

Turns out, there was a new release of the maven-filtering that changes the messages from info to debug. That removes the excessive messages and aligns the console output to the last version of the maven-resour ces-plugin.

We go from

[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] ignoreDelta true
[INFO] Copying 6 resources
[INFO] Copying file docs\asciidoc\docinfo.html
[INFO] Copying file docs\asciidoc\example-manual.adoc
[INFO] Copying file docs\asciidoc\images\sunset.jpg
[INFO] Copying file docs\asciidoc\subdir\_b.adoc
[INFO] Copying file docs\asciidoc\subdir\_c.adoc
[INFO] Copying file main\java\example\StringUtils.java

to

[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources

@ecki, @mojavelinux if it's fine for you, I'd upgrade the version in the same PR #306 and close this issue with it.

@ecki
Copy link
Author

ecki commented Aug 10, 2017

Fine with me. I think it is less confusing when the encoding would be the right one, but I agree that it probably does not apply.

abelsromero added a commit that referenced this issue Aug 11, 2017
… (#306)

* if set, uses project.build.sourceEncoding for resource filtering

* upgraded maven-filtering to 3.1.1 to reduce console messages
@abelsromero abelsromero added this to the 1.5.6 milestone Aug 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants