Files are changed during mvn compile process

56 views
Skip to first unread message

GeertVc

unread,
Jan 17, 2016, 9:39:51 AM1/17/16
to Pi4J
I've experienced a strange phenomenon recently while building the Pi4j tree.  After checking out a complete fresh git repository and running "mvn clean install", I see that many Java files are modified.  In those files, speical double quotes (not the regular ones) are replaced by a sequence of escape (?) characters, resulting in the following errors during compilation:


Loading source files for package com.pi4j.wiringpi...
5 errors
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Pi4J :: Parent POM ................................. SUCCESS [  1.223 s]
[INFO] Pi4J :: Java Library (Core) ........................ FAILURE [  4.995 s]
[INFO] Pi4J :: GPIO Extension ............................. SKIPPED
[INFO] Pi4J :: Device Abstractions ........................ SKIPPED
[INFO] Pi4J :: Java Examples .............................. SKIPPED
[INFO] Pi4J :: OSGi Service ............................... SKIPPED
[INFO] Pi4J :: Distribution ............................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.120 s
[INFO] Finished at: 2016-01-17T15:23:14+01:00
[INFO] Final Memory: 41M/558M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.2:jar (attach-javadocs) on project pi4j-core: MavenReportException: Error while creating archive:
[ERROR] Exit code: 1 - E:\AppData\Git\pi4j\pi4j-core\src\main\java\com\pi4j\wiringpi\Gpio.java:709: error: unmappable character for encoding UTF-8
[ERROR] * <p> The PWM generator can run in 2 modes ▒ ▒balanced?? and ▒mark:space??. The mark:space mode is traditional, however
[ERROR] ^
[ERROR] E:\AppData\Git\pi4j\pi4j-core\src\main\java\com\pi4j\wiringpi\Gpio.java:709: error: unmappable character for encoding UTF-8
[ERROR] * <p> The PWM generator can run in 2 modes ▒ ▒balanced?? and ▒mark:space??. The mark:space mode is traditional, however
[ERROR] ^
[ERROR] E:\AppData\Git\pi4j\pi4j-core\src\main\java\com\pi4j\wiringpi\Gpio.java:710: error: unmappable character for encoding UTF-8
[ERROR] *     the default mode in the Pi is ▒balanced??. You can switch modes by supplying the parameter: PWM_MODE_BAL or PWM_MODE_MS.</p>
[ERROR] ^
[ERROR] E:\AppData\Git\pi4j\pi4j-core\src\main\java\com\pi4j\wiringpi\Gpio.java:743: error: unmappable character for encoding UTF-8
[ERROR] * <p> This sets the ▒strength?? of the pad drivers for a particular group of pins. There are 3 groups of pins and the drive strength is from 0 to 7. Do not use this unless you know what you are doing. </p>
[ERROR] ^
[ERROR] E:\AppData\Git\pi4j\pi4j-core\src\main\java\com\pi4j\wiringpi\Gpio.java:765: error: unmappable character for encoding UTF-8
[ERROR] * <p> This sets the ▒frequency?? of a GPIO pin </p>
[ERROR] ^


To give an example: Gpio.java in .\pi4j-core\src\main\java\com\pi4j\wiringpi\Gpio.java.

Initial content of, say, line 709 (so, before invoking "mvn clean install"):

     * <p> The PWM generator can run in 2 modes – “balanced” and “mark:space”. The mark:space mode is traditional, however

Content of the same line after invoking "mvn clean install":

     * <p> The PWM generator can run in 2 modes – “balanced‿ and “mark:space‿. The mark:space mode is traditional, however

The strange characters after balanced and mark:space are represented as xE2x80? in my Notepad++ editor.

I have no idea who or what is changing the file content, simply because Maven is started?

I'm compiling on Windows 10, which has never been an issue so far...

Anyone any idea?

For the time being, I'll revert those special double-quotes to regular double-quotes again, but it would be nice to understand the problem and get a nice solution for it in place.  Unless it has to do with some settings in my environment???

Best rgds,
--Geert

GeertVc

unread,
Jan 17, 2016, 10:32:44 AM1/17/16
to Pi4J
The incident was narrowed down to only the file Gpio.java (the many other file changes were only the year that changed from 2015 to 2016 in the header template...).

I had issues with the following characters:
  • the special forward double-quote
  • the special backward double-quote
  • the special single quote (as in it's...)
  • the special hyphen

When I changed all those special characters into the regular double-quotes, single quotes or hyphens, the whole Pi4j project compiled again flawlessly.


Still a mystery as to why the file content is changed, why maven (javadoc, in fact, since the "problems" where in commented lines, not in real code) is having issues with those special characters and why I am having those issues...


PS: where's the trigger that changes the year in all headers?  Is it something in one of the POM files?  Just curious to know...

Robert Savage

unread,
Mar 16, 2016, 6:55:29 PM3/16/16
to Pi4J
Your pull-request to fix this issue was recently merged.

I believe it's this maven plugin that updates the license and copyright headers in source files:

Thanks, Robert
Reply all
Reply to author
Forward
0 new messages