Feature request: adding support for custom solr config #474

This commit is contained in:
Tom.Vandepoele
2017-06-29 15:15:54 +02:00
parent 012dc70f43
commit 82b7886a51
2 changed files with 30 additions and 0 deletions

View File

@@ -449,6 +449,35 @@ public abstract class AbstractRunMojo extends AbstractMojo {
);
}
/**
* Copy custom solr configuration files over, so a
* developer can overwrite any files needed
*
* @throws MojoExecutionException
*/
protected void copySolrCustomConfig() throws MojoExecutionException {
getLog().info("Copying custom Solr config");
executeMojo(
plugin(
groupId("org.apache.maven.plugins"),
artifactId("maven-resources-plugin"),
version(MAVEN_RESOURCE_PLUGIN_VERSION)
),
goal("copy-resources"),
configuration(
element(name("outputDirectory"), solrHome),
element(name("overwrite"), "true"),
element(name("resources"),
element(name("resource"),
element(name("directory"), "src/test/resources/solr"),
element(name("filtering"), "true")
)
)
),
execEnv
);
}
/**
* Replace property placeholders in configuration files for the cores, so the
* index files can be found for each core when Solr starts up.

View File

@@ -49,6 +49,7 @@ public class RunMojo extends AbstractRunMojo {
if (enableSolr) {
unpackSolrConfig();
fixSolrHomePath();
copySolrCustomConfig();
replaceSolrConfigProperties();
installSolr10InLocalRepo();
}