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>sandbox</module>
<module>spatial</module>
<module>spatial3d</module>
<module>suggest</module>
</modules>
<build>

View File

@ -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>
@lucene-spatial3d.internal.dependencies@
@lucene-spatial3d.external.dependencies@
@lucene-spatial3d.internal.test.dependencies@
@lucene-spatial3d.external.test.dependencies@
</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>

View File

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