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

2022-08-18 00:00:00 ant java jfreechart

我正在尝试构建此项目:

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

使用";mvn安装&命令时,出现以下错误:

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.jar8米的重量,这与MAVEN的JARhttps://repo1.maven.org/maven2/org/jfree/jfreechart/1.0.19/有很大的不同。请告诉我如何构建jfreechart版本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字节,与看到的1_565_065字节大小相当。您还需要jcommon-1.0.23.jar,包含在lib目录中并找到here。

附录:从repository的克隆开始,类似的方法也有效,在lib中生成一个1_565_051字节JAR和一个8Mjfreechart-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/
 …

相关文章