Solr是一個使用開源的搜索服務器,它採用Lucene Core的索引和搜索功能構建,它能夠用於幾乎全部的編程語言實現可擴展的搜索引擎。web
Solr的雖然有不少優勢,創建開發環境是否是其中之一。此博客條目介紹了咱們如何經過使用使用Maven運行Solr,並確保每一個開發人員使用相同的configuration, schema 和 Solr版本。apache
咱們的Maven構建的要求以下:編程
- The properties of our Maven build must be read from an external property file. The only exception to this rule is that the version numbers of the dependencies are declared in our POM file.
- The build process must copy the Solr configuration files to the correct directory when our Solr instance is started.
- The build process must clean up the configuration files when a developer executes mvn cleancommand at command prompt.
- It must be possible to start our Solr instance by using the Jetty Maven plugin.
We can fulfil these requirements by following these steps:服務器
- Create a POM file.
- Get the required dependencies.
- Get the Solr configuration files.
- Create the properties file which contain the properties used in our Maven build.
- Edit the solr.xml file.
- Configure the Properties Maven plugin.
- Configure the Copy Maven plugin.
- Configure the Jetty Maven plugin.
These steps are described with more details in the following.編程語言