Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
I am using the maven-aether-provider in my software and have an issue when Thailand users are publishing their snapshot versions get the Buddhist calendar year (offset of 543 years).
I have located the problem to be in the RemoteSnapShotMetaData class:
RemoteSnapShotMetaData.java
DateFormat utcDateFormatter = new SimpleDateFormat( "yyyyMMdd.HHmmss" ); utcDateFormatter.setTimeZone( TimeZone.getTimeZone( "UTC" ) ); snapshot = new Snapshot(); snapshot.setBuildNumber( getBuildNumber( recessive ) + 1 ); snapshot.setTimestamp( utcDateFormatter.format( new Date() ) );
The fix should be to explicitly set the calendar to be Gregorian:
RemoteSnapShotMetaData.java
DateFormat utcDateFormatter = new SimpleDateFormat( "yyyyMMdd.HHmmss" ); utcDateFormatter.setTimeZone( TimeZone.getTimeZone( "UTC" ) ); utcDateFormatter.setCalendar(new GregorianCalendar()); snapshot = new Snapshot(); snapshot.setBuildNumber( getBuildNumber( recessive ) + 1 ); snapshot.setTimestamp( utcDateFormatter.format( new Date() ) );