You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2014/01/29 19:03:25 UTC

svn commit: r1562530 - in /lucene/dev/trunk: dev-tools/maven/README.maven lucene/CHANGES.txt lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java

Author: sarowe
Date: Wed Jan 29 18:03:24 2014
New Revision: 1562530

URL: http://svn.apache.org/r1562530
Log:
LUCENE-5420: 'ant get-maven-poms' should support custom version formats

Modified:
    lucene/dev/trunk/dev-tools/maven/README.maven
    lucene/dev/trunk/lucene/CHANGES.txt
    lucene/dev/trunk/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java

Modified: lucene/dev/trunk/dev-tools/maven/README.maven
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/dev-tools/maven/README.maven?rev=1562530&r1=1562529&r2=1562530&view=diff
==============================================================================
--- lucene/dev/trunk/dev-tools/maven/README.maven (original)
+++ lucene/dev/trunk/dev-tools/maven/README.maven Wed Jan 29 18:03:24 2014
@@ -77,7 +77,7 @@ D. How to use Maven to build Lucene/Solr
 
    The details, followed by some example Maven commands:
 
-   1. Prerequisites: JDK 1.7+ and Maven 2.2.1 or 3.0.X
+   1. Prerequisites: JDK 1.7+ and Maven 2.2.1 or 3.X
 
    2. Make sure your sources are up to date.  If you checked your sources out
       from the Apache Subversion repository, run "svn update" from the top
@@ -97,10 +97,15 @@ D. How to use Maven to build Lucene/Solr
       filling in the project version with the default "X.X-SNAPSHOT".  If you
       want the POMs and the Maven-built artifacts to have a version other than
       the default, you can supply an alternate version on the command line
-      with the above command, e.g.:
+      with the above command, e.g. "my-special-version":
 
          ant -Dversion=my-special-version get-maven-poms
 
+      or to append "my-special-version" to the current base version, e.g. 5.0,
+      resulting in version "5.0-my-special-version":
+
+         ant -Ddev.version.suffix=my-special-version get-maven-poms
+
       Note: if you change the version in the POMs, there is one test method
       that will fail under maven-surefire-plugin:
       o.a.l.index.TestCheckIndex#testLuceneConstantVersion().  It's safe to

Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=1562530&r1=1562529&r2=1562530&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Wed Jan 29 18:03:24 2014
@@ -121,10 +121,10 @@ New Features
 
 Build
 
-* LUCENE-5217: Maven config: get dependencies from Ant+Ivy config; disable
-  transitive dependency resolution for all depended-on artifacts by putting
-  an exclusion for each transitive dependency in the <dependencyManagement>
-  section of the grandparent POM. (Steve Rowe)
+* LUCENE-5217,LUCENE-5420: Maven config: get dependencies from Ant+Ivy config;
+  disable transitive dependency resolution for all depended-on artifacts by
+  putting an exclusion for each transitive dependency in the
+  <dependencyManagement> section of the grandparent POM. (Steve Rowe)
 
 * LUCENE-5322: Clean up / simplify Maven-related Ant targets.
   (Steve Rowe)

Modified: lucene/dev/trunk/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java?rev=1562530&r1=1562529&r2=1562530&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java (original)
+++ lucene/dev/trunk/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java Wed Jan 29 18:03:24 2014
@@ -80,10 +80,6 @@ public class GetMavenDependenciesTask ex
   // lucene/build/core/classes/java
   private static final Pattern COMPILATION_OUTPUT_DIRECTORY_PATTERN 
       = Pattern.compile("(lucene|solr)/build/(?:contrib/)?(.*)/classes/(?:java|test)");
-  // Local:   lucene/build/analysis/common/lucene-analyzers-common-5.0-SNAPSHOT.jar
-  // Jenkins: lucene/build/analysis/common/lucene-analyzers-common-5.0-2013-10-31_18-52-24.jar
-  private static final Pattern INTERNAL_JAR_PATTERN 
-      = Pattern.compile(".*(lucene|solr)([^/]*?)-\\d[-._\\d]*(?:-SNAPSHOT)?\\.jar");
   private static final Pattern PROPERTY_REFERENCE_PATTERN = Pattern.compile("\\$\\{([^}]+)\\}");
   private static final String UNWANTED_INTERNAL_DEPENDENCIES
       = "/(?:test-)?lib/|test-framework/classes/java|/test-files|/resources";
@@ -101,7 +97,7 @@ public class GetMavenDependenciesTask ex
     // - they need compile-scope deps to also be test-scope deps.
     modulesWithSeparateCompileAndTestPOMs.addAll
         (Arrays.asList("lucene-core", "lucene-codecs", "solr-core", "solr-solrj"));
-    
+
     // Add external dependencies here that should be optional (i.e., not invoke Maven's transitive dep mechanism).
     // Format is "groupId:artifactId"
     optionalExternalDependencies.addAll(Arrays.asList
@@ -618,7 +614,13 @@ public class GetMavenDependenciesTask ex
       }
       artifactId.append(artifact);
     } else {
-      matcher = INTERNAL_JAR_PATTERN.matcher(dependency);
+      // Local:   lucene/build/analysis/common/lucene-analyzers-common-5.0-SNAPSHOT.jar
+      // Jenkins: lucene/build/analysis/common/lucene-analyzers-common-5.0-2013-10-31_18-52-24.jar
+      // Also support any custom version, which won't necessarily conform to any predefined pattern.
+      Pattern internalJarPattern = Pattern.compile(".*(lucene|solr)([^/]*?)-"
+                                 + Pattern.quote(getProject().getProperty("version")) + "\\.jar");
+
+      matcher = internalJarPattern.matcher(dependency);
       if (matcher.matches()) {
         // Pattern.compile(".*(lucene|solr)([^/]*?)-(?:\\d\\.)+\\d(?:-SNAPSHOT)?\\.jar)")
         artifactId.append(matcher.group(1));