我最近正在使用 sonar.projectDate 属性构建历史。但是,我弄错了日期并将其设置为未来 (2913-05-29)。现在我无法对该项目进行任何新的分析。由于这是最新的分析,我在历史记录页面上没有“删除快照”按钮。
所以,我想简单地更改分析日期,因为它是有效的并且是最新的。我对以下似乎有“错误”日期的表格进行了更改:快照、事件、问题。
update snapshots set
created_at = to_timestamp('05/29/2013', 'MM/dd/yyyy'),
period2_date = to_timestamp('05/24/2013', 'MM/dd/yyyy'),
period3_date = to_timestamp('04/29/2013', 'MM/dd/yyyy')
where id = ${snapshotId};
update snapshots set
created_at = to_timestamp('05/29/2013', 'MM/dd/yyyy')
where root_snapshot_id = ${snapshotId};
update events set
event_date = to_timestamp('05/29/2013', 'MM/dd/yyyy')
where snapshot_id = ${snapshotId};
严格来说,我认为我不需要这样做,因为它与快照无关,但我认为它有助于解决问题。
update issues set
issue_creation_date = to_timestamp('05/29/2013', 'MM/dd/yyyy'),
issue_update_date = to_timestamp('05/29/2013', 'MM/dd/yyyy'),
created_at = to_timestamp('05/29/2013', 'MM/dd/yyyy'),
updated_at = to_timestamp('05/29/2013', 'MM/dd/yyyy')
where root_component_id = ${projectId}
and created_at > to_timestamp('01/01/2014', 'MM/dd/yyyy');
更新快照表后,GUI 加载了正确的信息,但我仍然无法开始新的分析。
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project rc-parent:
Can not execute Sonar: 'sonar.projectDate' property cannot be older than the date of the last known quality snapshot on this project. Value: '2013-06-29'. Latest quality snapshot: '2913-05-29'. This property may only be used to rebuild the past in a chronological order. -> [Help 1]
我现在正在运行 Sonar 3.6,但在“坏”分析运行期间运行的是 3.4.1。
我正在寻找选项。更改日期的正确方法或手动分析删除程序。