Thank you for the insight Jesse.
Please verify whether the file is actually valid in UTF-8 encoding, or
> if not, what encoding it is in. And what operating system do you use?
> I am wondering if there is an issue with the platform default
> encoding.
>
My laptop has the following Environment:
- Windows 7, English
- JDK 1.7.0_25
- Maven 3.0.5
- Git Bash 1.8.3
- Intellij IDEA 12.1.4
jrunscript -e 'println(java.lang.System.getProperty("file.encoding"))'
This outputs Cp1252.
I have been digging deeper into this. When I compile the project in the
Terminal I see this output:
fidel@ARULCO /d/ccd/workshop/jenkins/core (cleanup)
$ mvn clean compile
...
[INFO] --- build-helper-maven-plugin:1.7:add-source (add-source) @
jenkins-core ---
[INFO] Source directory:
d:\ccd\workshop\jenkins\core\target\generated-sources\antlr added.
[INFO] Source directory:
d:\ccd\workshop\jenkins\core\target\generated-sources\localizer added.
...
[INFO] --- maven-localizer-plugin:1.14:generate (default) @ jenkins-core ---
...
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @
jenkins-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 916 source files to
d:\ccd\workshop\jenkins\core\target\classes
[WARNING]
/d:/ccd/workshop/jenkins/core/target/generated-sources/taglib-interface/lib/LayoutTagLib.java:[730,36]
unmappable character for encoding UTF-8
...
[WARNING]
/d:/ccd/workshop/jenkins/core/target/generated-sources/localizer/hudson/scheduler/Messages.java:[33,36]
unmappable character for encoding UTF-8
...
The compiler warnings about unmappable characters in LayoutTagLib.java and
in Messages.java indicate an encoding issue. When I open these two files in
Notepad++ he detects them as UTF-8 without BOM.
But when I try to generate the sources in the Terminal (mvn clean
generate-sources) and launch a subsequent build of the module inside
Intellij (Make Project) it results in compile errors:
D:\ccd\workshop\jenkins\core\target\generated-sources\localizer\hudson\scheduler\Messages.java
error: unmappable character for encoding UTF-8
@Kohsuke maybe we could retire this questionable Maven plugin and just
> use a JSR 269 processor? That would pick up the right encoding for
> Java sources without hassle, and would have some ancillary benefits;
> e.g. 269-aware IDEs may immediately offer code completion on
> Messages.java methods as soon as you save changes to
> Messages.properties, without requiring a Maven build. It would be
> slightly tricky to enumerate all the available Messages.properties
> files, since JSR 269 does not offer this capability, but you could
> work around that by checking explicitly for Messages.properties
> resource in each package for which a root element was encountered in
> the round environment.
>
This seems a questionable plugin indeed. I could not find this plugin's
home page and mvn localizer:help produced an error message saying he does
not know the 'help' goal, which regular Maven plugins should support.
Furthermore, I could not trigger its execution in Intellij during the
'generate-sources' phase, even when I set this explicitly in the plugin's
configuration in the POM. So this basically makes "Rebuild Project" inside
Intellij impossible and forces the developer to use both Terminal and IDE
for this basic task. But even with a Terminal, the encoding issues from
above emerge so I cannot compile the module.
Not as good as it should be, but I will try to find a workaround for
this...
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.