Apache Solr open-source search software
LUCENE-6607: Fix spatial3d module's Maven config - include dependency interpolation sites, make packaging jar instead of pom, don't skip deploy phase, etc.; and fix GetMavenDependenciesTask to exclude a module's build artifacts only if the build dir fully matches, rather than a prefix (this bug caused lucene-spatial's test dependency on the lucene-spatial3d jar to be left out of the generated POM, because lucene/build/spatial3d matched the regex for lucene-spatial's build output dir: 'lucene/build/spatial', i.e. with no dir separator)
Steven Rowe33d18a0c599a
diff --git a/dev-tools/maven/lucene/pom.xml.template b/dev-tools/maven/lucene/pom.xml.templateindex 0e9486354d4..9a7d1ecda8e 100644--- a/dev-tools/maven/lucene/pom.xml.template+++ b/dev-tools/maven/lucene/pom.xml.template@@ -60,6 +60,7 @@<module>replicator</module><module>sandbox</module><module>spatial</module>+ <module>spatial3d</module><module>suggest</module></modules><build>diff --git a/dev-tools/maven/lucene/spatial3d/pom.xml.template b/dev-tools/maven/lucene/spatial3d/pom.xml.templateindex 31ab42ebf0a..18d943f7e73 100644--- a/dev-tools/maven/lucene/spatial3d/pom.xml.template+++ b/dev-tools/maven/lucene/spatial3d/pom.xml.template@@ -28,17 +28,30 @@</parent><groupId>org.apache.lucene</groupId><artifactId>lucene-spatial3d</artifactId>- <packaging>pom</packaging>- <name>Lucene Spatial shapes implemented using 3D planar geometry</name>+ <packaging>jar</packaging>+ <name>Lucene Spatial 3D</name>+ <description>+ Lucene Spatial shapes implemented using 3D planar geometry+ </description>+ <properties>+ <module-directory>lucene/spatial3d</module-directory>+ <relative-top-level>../../..</relative-top-level>+ <module-path>${relative-top-level}/${module-directory}</module-path>+ </properties>+ <dependencies>+ <dependency>+ <!-- lucene-test-framework dependency must be declared before lucene-core -->+ <groupId>org.apache.lucene</groupId>+ <artifactId>lucene-test-framework</artifactId>+ <scope>test</scope>+ </dependency>+ </dependencies><build>- <plugins>- <plugin>- <groupId>org.apache.maven.plugins</groupId>- <artifactId>maven-deploy-plugin</artifactId>- <configuration>- <skip>true</skip>- </configuration>- </plugin>- </plugins>+ <sourceDirectory>${module-path}/src/java</sourceDirectory>+ <testSourceDirectory>${module-path}/src/test</testSourceDirectory></build></project>diff --git a/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java b/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.javaindex 09314c01233..7fb60b174e8 100644--- a/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java+++ b/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java@@ -549,8 +549,10 @@ public class GetMavenDependenciesTask extends Task {} else {// Lucene analysis modules' build dirs do not include hyphens, but Solr contribs' build dirs doString origModuleDir = antProjectName.replace("analyzers-", "analysis/");+ // Exclude the module's own build output, in addition to UNWANTED_INTERNAL_DEPENDENCIESPattern unwantedInternalDependencies = Pattern.compile- ("(?:lucene/build/|solr/build/(?:contrib/)?)" + origModuleDir + "|" + UNWANTED_INTERNAL_DEPENDENCIES);+ ("(?:lucene/build/|solr/build/(?:contrib/)?)" + origModuleDir + "/" // require dir separator+ + "|" + UNWANTED_INTERNAL_DEPENDENCIES);SortedSet<String> sortedDeps = new TreeSet<>();for (String dependency : value.split(",")) {matcher = SHARED_EXTERNAL_DEPENDENCIES_PATTERN.matcher(dependency);