Commit 82b7886a authored by Tom.Vandepoele's avatar Tom.Vandepoele
Browse files

Feature request: adding support for custom solr config #474

parent 012dc70f
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -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.
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ public class RunMojo extends AbstractRunMojo {
        if (enableSolr) {
            unpackSolrConfig();
            fixSolrHomePath();
            copySolrCustomConfig();
            replaceSolrConfigProperties();
            installSolr10InLocalRepo();
        }