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)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1690842 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2015-07-13 23:45:20 +00:00
parent e700c04800
commit 33d18a0c59
3 changed files with 28 additions and 12 deletions

View File

@ -60,6 +60,7 @@
<module>replicator</module> <module>replicator</module>
<module>sandbox</module> <module>sandbox</module>
<module>spatial</module> <module>spatial</module>
<module>spatial3d</module>
<module>suggest</module> <module>suggest</module>
</modules> </modules>
<build> <build>

View File

@ -28,17 +28,30 @@
</parent> </parent>
<groupId>org.apache.lucene</groupId> <groupId>org.apache.lucene</groupId>
<artifactId>lucene-spatial3d</artifactId> <artifactId>lucene-spatial3d</artifactId>
<packaging>pom</packaging> <packaging>jar</packaging>
<name>Lucene Spatial shapes implemented using 3D planar geometry</name> <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>
@lucene-spatial3d.internal.dependencies@
@lucene-spatial3d.external.dependencies@
@lucene-spatial3d.internal.test.dependencies@
@lucene-spatial3d.external.test.dependencies@
</dependencies>
<build> <build>
<plugins> <sourceDirectory>${module-path}/src/java</sourceDirectory>
<plugin> <testSourceDirectory>${module-path}/src/test</testSourceDirectory>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build> </build>
</project> </project>

View File

@ -549,8 +549,10 @@ public class GetMavenDependenciesTask extends Task {
} else { } else {
// Lucene analysis modules' build dirs do not include hyphens, but Solr contribs' build dirs do // Lucene analysis modules' build dirs do not include hyphens, but Solr contribs' build dirs do
String origModuleDir = antProjectName.replace("analyzers-", "analysis/"); String origModuleDir = antProjectName.replace("analyzers-", "analysis/");
// Exclude the module's own build output, in addition to UNWANTED_INTERNAL_DEPENDENCIES
Pattern unwantedInternalDependencies = Pattern.compile Pattern 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<>(); SortedSet<String> sortedDeps = new TreeSet<>();
for (String dependency : value.split(",")) { for (String dependency : value.split(",")) {
matcher = SHARED_EXTERNAL_DEPENDENCIES_PATTERN.matcher(dependency); matcher = SHARED_EXTERNAL_DEPENDENCIES_PATTERN.matcher(dependency);