[ 
https://issues.apache.org/jira/browse/MNG-5877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14935022#comment-14935022
 ] 

Hudson commented on MNG-5877:
-----------------------------

SUCCESS: Integrated in maven-3.x #1124 (See 
[https://builds.apache.org/job/maven-3.x/1124/])
[MNG-5877] maven-aether-provider does not always generate snapshot versions 
using Gregorian calendar year (michaelo: rev 
5cbc294e72c79955fb93c6434e9ac8ae7d9206cc)
* 
maven-aether-provider/src/test/java/org/apache/maven/repository/internal/RemoteSnapshotMetadataTest.java
* 
maven-aether-provider/src/main/java/org/apache/maven/repository/internal/RemoteSnapshotMetadata.java


> maven-aether-provider does not always generate snapshot versions using 
> Gregorian calendar year 
> -----------------------------------------------------------------------------------------------
>
>                 Key: MNG-5877
>                 URL: https://issues.apache.org/jira/browse/MNG-5877
>             Project: Maven
>          Issue Type: Bug
>            Reporter: Anders Forsell
>            Assignee: Michael Osipov
>             Fix For: 3.3.7
>
>
> 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:
> {code:title=RemoteSnapShotMetaData.java|borderStyle=solid}
>             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() ) );
> {code}
> The fix should be to explicitly set the calendar to be Gregorian:
> {code:title=RemoteSnapShotMetaData.java|borderStyle=solid}
>             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() ) );
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to