无法从源代码构建 Cassandra

fir*_*yer 2 java ant cassandra

我使用的是 Mac OS X,我的 ant、java 依赖满足了最低要求。当我构建源代码时

ant build
Run Code Online (Sandbox Code Playgroud)

我得到了这样的错误:

 [echo] apache-cassandra: /Users/taiyuanz/git/cassandra-trunk/build.xml
[javac] Compiling 890 source files to /Users/taiyuanz/git/cassandra-trunk/build/classes/main
[javac] Note: Processing compiler hints annotations
[javac] warning: Supported source version 'RELEASE_6' from annotation processor 'org.openjdk.jmh.generators.BenchmarkProcessor' less than -source '1.8'
[javac] /Users/taiyuanz/git/cassandra-trunk/src/java/org/apache/cassandra/db/partitions/AbstractBTreePartition.java:33: error: reference to Row is ambiguous
[javac] public abstract class AbstractBTreePartition implements Partition, Iterable<Row>
[javac]                                                                             ^
[javac]   both interface org.apache.cassandra.db.rows.Row in org.apache.cassandra.db.rows and class org.apache.cassandra.db.Row in org.apache.cassandra.db match
[javac] /Users/taiyuanz/git/cassandra-trunk/src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java:72: error: reference to Row is ambiguous
[javac]     private BTree.Builder<Row> rowBuilder;
[javac]                           ^
[javac]   both interface org.apache.cassandra.db.rows.Row in org.apache.cassandra.db.rows and class org.apache.cassandra.db.Row in org.apache.cassandra.db match
[javac] /Users/taiyuanz/git/cassandra-trunk/src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java:164: error: reference to Row is ambiguous
[javac]     public static PartitionUpdate singleRowUpdate(CFMetaData metadata, DecoratedKey key, Row row)
.......
Run Code Online (Sandbox Code Playgroud)

都是因为同样的问题 - 由于 Row 类引起的歧义。如何解决这个问题?

mik*_*kea 5

看起来您的源代码树中有来自 3.0 之前和 3.0 之后的 Cassandra 的源代码。我会跑:

git clean -xfd
Run Code Online (Sandbox Code Playgroud)

看看能不能解决。否则,删除存储库并使用干净的克隆重新开始。