运行ant for lucene源代码

时间:2018-03-15 08:54:51

标签: lucene

我从https://github.com/apache/lucene-solr.git分叉了lucene-solr。 然后在目录中运行ant并得到以下错误。

  

alexkkk @ alexkkk-host:lucene-solr /(master)$ ant idea [16:44:41]   构建文件:/Users/alexkkk/Projects/lucene-solr/build.xml

     

建立失败   /Users/alexkkk/Projects/lucene-solr/build.xml:21:执行此行时发生以下错误:   /Users/alexkkk/Projects/lucene-solr/lucene/common-build.xml:623:java.lang.NullPointerException     在java.util.Arrays.stream(Arrays.java:5004)     在java.util.stream.Stream.of(Stream.java:1000)     at java.util.stream.ReferencePipeline $ 7 $ 1.accept(ReferencePipeline.java:267)     at java.util.stream.ReferencePipeline $ 3 $ 1.accept(ReferencePipeline.java:193)     at java.util.Spliterators $ ArraySpliterator.forEachRemaining(Spliterators.java:948)     at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)     at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)     在java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:545)     at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)     在java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:438)     at org.apache.tools.ant.util.ChainedMapper.lambda $ mapFileName $ 1(ChainedMapper.java:36)     at java.util.stream.ReduceOps $ 1ReducingSink.accept(ReduceOps.java:80)     at java.util.ArrayList $ ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)     at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)     at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)     在java.util.stream.ReduceOps $ ReduceOp.evaluateSequential(ReduceOps.java:708)     at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)     在java.util.stream.ReferencePipeline.reduce(ReferencePipeline.java:484)     at org.apache.tools.ant.util.ChainedMapper.mapFileName(ChainedMapper.java:35)     at org.apache.tools.ant.util.CompositeMapper.lambda $ mapFileName $ 0(CompositeMapper.java:32)     at java.util.stream.ReferencePipeline $ 3 $ 1.accept(ReferencePipeline.java:193)     at java.util.stream.ReferencePipeline $ 2 $ 1.accept(ReferencePipeline.java:175)     at java.util.ArrayList $ ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)     at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)     at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)     在java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:545)     at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)     在java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:438)     at org.apache.tools.ant.util.CompositeMapper.mapFileName(CompositeMapper.java:33)     在org.apache.tools.ant.taskdefs.PathConvert.execute(PathConvert.java:363)     在org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)     at sun.reflect.GeneratedMethodAccessor4.invoke(未知来源)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     在org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)     at org.apache.tools.ant.Task.perform(Task.java:346)     在org.apache.tools.ant.Target.execute(Target.java:448)     在org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:172)     at org.apache.tools.ant.taskdefs.ImportTask.importResource(ImportTask.java:221)     在org.apache.tools.ant.taskdefs.ImportTask.execute(ImportTask.java:165)     在org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     在org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)     at org.apache.tools.ant.Task.perform(Task.java:346)     在org.apache.tools.ant.Target.execute(Target.java:448)     在org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:183)     在org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:93)     在org.apache.tools.ant.Main.runBuild(Main.java:824)     在org.apache.tools.ant.Main.startAnt(Main.java:228)     在org.apache.tools.ant.launch.Launcher.run(Launcher.java:283)     在org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

     

总时间:0秒

1 个答案:

答案 0 :(得分:0)

正如本thread所述。您必须将您的蚂蚁从版本1.10.2降级到1.10.1或1.9。

如果你使用Mac并使用自制软件来安装你的蚂蚁。你可以安装ant 1.9。

brew install ant@1.9

然后取消链接版本1.10.2并链接版本1.9。

brew unlink ant
brew link --force ant@1.9

使用ant 1.9,您应该能够编译Lucene。