Last modified: 2014-01-06 10:31:13 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T47042, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45042 - Jenkins: Enforce utf-8 for maven builds
Jenkins: Enforce utf-8 for maven builds
Status: RESOLVED WONTFIX
Product: Wikimedia
Classification: Unclassified
Continuous integration (Other open bugs)
wmf-deployment
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-15 14:07 UTC by Chad H.
Modified: 2014-01-06 10:31 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Chad H. 2013-02-15 14:07:32 UTC
Right now, we're not explicitly building things with an explicit encoding, and relying on the system's encoding. This ends up with warnings such as:

[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!

This is probably fine as long as we stick with utf-8, but it'd probably be nice to be explicit. This can be solved by creating ~/.m2/settings.xml for the jenkins user with the following:

<settings>
	<profiles>
		<profile>
			<id>profile-utf</id>
			<properties>
				<project.build.sourceEncoding>
					UTF-8
				</project.build.sourceEncoding>
				<project.reporting.outputEncoding>
					UTF-8
				</project.reporting.outputEncoding>
			</properties>
		</profile>
	</profiles>

	<activeProfiles>
		<activeProfile>profile-utf</activeProfile>
	</activeProfiles>
</settings>
Comment 1 Antoine "hashar" Musso (WMF) 2013-02-15 16:14:00 UTC
I guess that should be set explicitly in the project being build.

If there is any maven command line option to set the encoding, the option can be configured in Jenkins general config https://integration.mediawiki.org/ci/configure
Comment 2 Chad H. 2013-02-15 16:27:03 UTC
(In reply to comment #1)
> I guess that should be set explicitly in the project being build.
> 

In theory. In practice, nobody specifies encoding in their poms.

> If there is any maven command line option to set the encoding, the option can
> be configured in Jenkins general config
> https://integration.mediawiki.org/ci/configure

Good to know. May just set it globally.
Comment 3 Krinkle 2013-06-25 18:41:47 UTC
I'm not familiar with Maven, how do we configure it globally? I'd be happy to do it.
Comment 4 Antoine "hashar" Musso (WMF) 2013-06-25 18:43:37 UTC
Chad can you look up the global setting that need to be passed to maven to override the encoding?  Then we can set it globally in Jenkins system configuration and the warning will disappear for all Maven based jobs :-]
Comment 5 Antoine "hashar" Musso (WMF) 2013-06-26 08:48:23 UTC
From http://stackoverflow.com/questions/3160547/passing-maven-compiler-options-from-the-command-line it seems we can pass:

-Dproject.build.sourceEncoding=UTF-8 -Dproject.reporting.outputEncoding=UTF-8
Comment 6 Antoine "hashar" Musso (WMF) 2013-06-28 13:04:16 UTC
I have setup the parameters in Jenkins global configuration MAVEN_OPTS but that did not work while triggering a maven job https://integration.wikimedia.org/ci/job/Android-Commons%20(mobile)%20-%20Nightly%20builds/172/console
Comment 7 Antoine "hashar" Musso (WMF) 2013-12-02 14:12:34 UTC
Chad is that still needed ? or should we just close the bug? :-D
Comment 8 Antoine "hashar" Musso (WMF) 2014-01-06 10:31:13 UTC
Closing bug as I don't think it is worth the effort right now.  If you find out a way to enforce encoding in maven job, go ahead.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links