Return-Path: X-Original-To: apmail-maven-issues-archive@minotaur.apache.org Delivered-To: apmail-maven-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9E9B718B3C for ; Tue, 29 Sep 2015 08:05:04 +0000 (UTC) Received: (qmail 86538 invoked by uid 500); 29 Sep 2015 08:05:04 -0000 Delivered-To: apmail-maven-issues-archive@maven.apache.org Received: (qmail 86489 invoked by uid 500); 29 Sep 2015 08:05:04 -0000 Mailing-List: contact issues-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list issues@maven.apache.org Received: (qmail 86475 invoked by uid 99); 29 Sep 2015 08:05:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Sep 2015 08:05:04 +0000 Date: Tue, 29 Sep 2015 08:05:04 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@maven.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MNG-5877) maven-aether-provider does not always generate snapshot versions using Gregorian calendar year MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MNG-5877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14934822#comment-14934822 ] ASF GitHub Bot commented on MNG-5877: ------------------------------------- Github user michael-o commented on the pull request: https://github.com/apache/maven/pull/65#issuecomment-143978524 @josephw Can you kind rebase on current master? > 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 > > 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)