Search code examples
lucenemaven-2lucene-highlighter

Does a pom.xml.template tell me everything I need to know to use the project as a dependency


I'm trying to add the lucene sandbox contribution called term-highlighter to my pom.xml. I'm not really that familiar with Maven, but the code has a pom.xml.template which seems to imply if I add a dependency that looks like:

<dependency>
  <groupId>org.apache.lucene</groupId>
  <artifactId>lucene-highlighter</artifactId>
</dependency>

It might work. Can someone help me out in adding a lucene-community project to my pom.xml file?

Thanks for the comments, it turns out that adding the version was all I needed, and I just guessed it should match the lucene-core version I was using.:

<dependency>
    <groupId>org.apache.lucene</groupId>
    <artifactId>lucene-highlighter</artifactId>
    <version>2.3.1</version>
</dependency>

Solution

  • You have to add the version number, but you only have to do it once in a project structure. That is, if the version number is defined in a parent pom, you don't have to give the version number again. (But you don't even have to provide the dependency in this case since the dependency will be inherited anyways.)