如何从源代码构建 jfreechart-1.0.19?

How to build jfreechart-1.0.19 from sources?

我正在尝试构建这个项目:

git clone --depth 1 --branch v1.0.19 https://github.com/jfree/jfreechart.git

使用“mvn install”命令,出现以下错误:

Failed tests:   testFifteenMinIncludedAndExcludedSegments(org.jfree.chart.axis.SegmentedTimelineTest)
  testFifteenMinSegmentedTimeline(org.jfree.chart.axis.SegmentedTimelineTest): expected:<-2208956400000> but was:<-2208967200000>
  testMondayThroughFridaySegmentedTimeline(org.jfree.chart.axis.SegmentedTimelineTest): expected:<-2208988800000> but was:<-2208999600000>
  testFindDomainBounds(org.jfree.data.time.TimeSeriesCollectionTest): expected:<1.199142E12> but was:<1.1991348E12>

然后我尝试使用 ANT 脚本构建

cd ant
ant

我得到了 jfreechart-1.0.19-bundle.jar 8M 重量,这与 MAVEN 的 jar https://repo1.maven.org/maven2/org/jfree/jfreechart/1.0.19/ . Please tell me how to build 版本 1.0.19 形式来源有很大不同?

尝试从找到的原始源代码分发中构建 here。验证校验和,解压缩文件并使用 ant:

构建
$ java -version
java version "11.0.10" 2021-01-19 LTS…
$ md5 jfreechart-1.0.19.zip 
MD5 (jfreechart-1.0.19.zip) = 69a5c88439566ac9d7e74cf34c69b7e0
$ unzip -qq jfreechart-1.0.19.zip 
$ pushd jfreechart-1.0.19
$ pushd ant ; ant ; popd
…
BUILD SUCCESSFUL

对于 lib/jfreechart-1.0.19.jar,我得到 1_565_109 字节的大小,与看到 here. You also need jcommon-1.0.23.jar, included in the lib directory and found here.

1_565_065 字节相当

附录:从 repository 的克隆开始,类似的方法也有效,在 lib 中生成 1_565_051 字节的 JAR和一个 8M jfreechart-1.0.19-bundle.jar:

$ git clone https://github.com/jfree/jfreechart.git jfreechart
$ pushd jfreechart
$ git fetch --tags
$ git tag --list
…
v1.0.19
…
$ git checkout v1.0.19
Note: switching to 'v1.0.19'…
$ pushd ant ; ant ; popd
…
BUILD SUCCESSFUL
$ git checkout master
$ git status
…
Untracked files:
  (use "git add <file>..." to include in what will be committed)
    jfreechart-1.0.19-bundle.jar
    jfreechart-1.0.19-javadocs.zip
    jfreechart-1.0.19.tar.gz
    jfreechart-1.0.19.zip
    lib/
 …