1

I want to compile Nutch 2.2.1 to use with MongoDB for data storage.

I changed gora-core to 0.5 in file ivy.xml:

<dependency org="org.apache.gora" name="gora-core" rev="0.5" conf="*->default"/>

Also added dependency for mongodb in ivy/ivy.xml file:

<dependency org="org.apache.gora" name="gora-mongodb" rev="0.5" conf="*->default" />

Added mongodb config in conf/gora.properties:

############################
# MongoDBStore properties  #
############################
gora.datastore.default=org.apache.gora.mongodb.store.MongoStore
gora.mongodb.override_hadoop_configuration=false
gora.mongodb.mapping.file=/gora-mongodb-mapping.xml
gora.mongodb.servers=localhost:27017
gora.mongodb.db=nutch

Added gora-mongodb-mapping.xml to conf directory from Nutch-2.3-SNAPSHOT.

When I am trying to compile I get error:

Could not load definitions from resource org/sonar/ant/antlib.xml. It could not be found.

After which I get many compiler errors.

When I try to configure and compile Nutch with MySQL every compiles and work perfectly.

I am trying to compile on Debian.

2 Answers2

0

The error is being thrown because the sonar jar is not present in one of the classpaths (see build.xml, line 883)

<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
    <classpath path="${ant.library.dir}"/>
    <classpath path="${mysql.library.dir}"/>
</taskdef>

It looks like the warning can be safely ignored, because it's only required when running the "sonar" target.

One simple solution would be to move the taskdef within the "sonar" target. That would avoid the error message.

I would suggest raising a JIRA issue to get this fixed.

Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
0

After correcting this error I got another ;-). After research I found what it is not possible to compile Nutch 2.2.1 with Gora 0.5 to use MongoDB (gora-mongodb rev=0.5).

I have cloned Nutch 2.3 and successfully compiled it.

  • Yes, I was helping one of the nutch developers on that point! See: http://stackoverflow.com/questions/27721507/ivy-can-not-resolve-the-scope-of-a-dependency-which-is-a-dependency-of-a-transit . The ivy configuration used by Nutch could do with a face-lift ;-) – Mark O'Connor Jan 14 '15 at 20:09