You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2021/03/12 11:57:13 UTC
[lucene-solr] branch branch_8x updated: LUCENE-9836: Remove ant
run-maven-build (won't bootstrap anymore),
fix more places where the secured Maven Central repo is needed to execute
This is an automated email from the ASF dual-hosted git repository.
uschindler pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/branch_8x by this push:
new c2d5f41 LUCENE-9836: Remove ant run-maven-build (won't bootstrap anymore), fix more places where the secured Maven Central repo is needed to execute
c2d5f41 is described below
commit c2d5f410e51678dcc6b538b303f054c41189aa1f
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Fri Mar 12 12:56:58 2021 +0100
LUCENE-9836: Remove ant run-maven-build (won't bootstrap anymore), fix more places where the secured Maven Central repo is needed to execute
---
build.xml | 15 +-------
dev-tools/maven/pom.xml.template | 2 +-
lucene/common-build.xml | 14 +++++---
lucene/tools/src/groovy/run-maven-build.groovy | 49 --------------------------
4 files changed, 12 insertions(+), 68 deletions(-)
diff --git a/build.xml b/build.xml
index ff1e4c1..03e103a 100755
--- a/build.xml
+++ b/build.xml
@@ -25,7 +25,6 @@
<property name="tests.heap-dump-dir" location="heapdumps"/>
<property name="maven-build-dir" value="maven-build"/>
- <property name="maven-version" value="2.2.1"/>
<property name="maven.dependencies.filters.file" location="lucene/build/maven.dependencies.filters.properties"/>
<property name="smokeTestRelease.dir" location="lucene/build/smokeTestRelease/dist"/>
@@ -239,10 +238,6 @@
</subant>
</target>
- <target name="run-maven-build" depends="get-maven-poms,install-maven-tasks,resolve-groovy" description="Runs the Maven build using automatically generated POMs">
- <groovy src="${common.dir}/tools/src/groovy/run-maven-build.groovy"/>
- </target>
-
<target name="remove-maven-artifacts" description="Removes all Lucene/Solr Maven artifacts from the local repository">
<echo message="Removing all Lucene/Solr Maven artifacts from '${user.home}/.m2/repository'..."/>
<delete includeemptydirs="true">
@@ -669,21 +664,13 @@ Test args: [${args}]</echo>
</target>
<target name="jenkins-maven-nightly" depends="-print-java-info,clean,clean-maven-build,resolve-groovy,resolve-markdown,install-maven-tasks">
- <!-- step 1: build, install, validate and publish ANT-generated maven artifacts: -->
+ <!-- build, install, validate and publish ANT-generated maven artifacts: -->
<antcall>
<param name="is.jenkins.build" value="true"/>
<target name="remove-maven-artifacts"/>
<target name="validate-maven-dependencies"/>
<target name="generate-maven-artifacts"/>
</antcall>
- <!-- step 2: run the maven build to check that the pom templates also work to drive "mvn": -->
- <!-- disabled as it does not work anymore on jenkins...
- <antcall>
- <param name="is.jenkins.build" value="true"/>
- <target name="remove-maven-artifacts"/>
- <target name="run-maven-build"/>
- </antcall>
- -->
</target>
<target name="jenkins-clover" depends="-print-java-info">
diff --git a/dev-tools/maven/pom.xml.template b/dev-tools/maven/pom.xml.template
index 36c3cc8..2f08ebf 100644
--- a/dev-tools/maven/pom.xml.template
+++ b/dev-tools/maven/pom.xml.template
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
- <version>13</version>
+ <version>23</version>
<relativePath/>
</parent>
<groupId>org.apache.lucene</groupId>
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index 4b00e56..dd0234b 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -701,7 +701,9 @@
<attribute name="jar.file" default="${dist.jar.dir.prefix}-${version}/${dist.jar.dir.suffix}/${final.name}.jar"/>
<sequential>
<parent-poms/>
- <artifact:pom id="maven.project" file="@{pom.xml}"/>
+ <artifact:pom id="maven.project" file="@{pom.xml}">
+ <remoteRepository id="${maven.repository.id}" url="${ivy_bootstrap_url1}" />
+ </artifact:pom>
<artifact:install file="@{jar.file}">
<pom refid="maven.project"/>
</artifact:install>
@@ -717,8 +719,8 @@
<sequential>
<artifact:dependencies filesetId="maven.fileset" useScope="test" type="jar">
<artifact:pom file="@{pom.xml}"/>
- <!-- disable completely, so this has no chance to download any updates from anywhere: -->
<remoteRepository id="${maven.repository.id}" url="${ivy_bootstrap_url1}" />
+ <!-- disable completely, so this has no chance to download any updates from anywhere: -->
<remoteRepository id="apache.snapshots" url="foobar://disabled/">
<snapshots enabled="false"/>
<releases enabled="false"/>
@@ -1774,7 +1776,9 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
</mapper>
<path location="${ant.file}"/>
</pathconvert>
- <artifact:pom id="maven.project" file="${pom.xml}"/>
+ <artifact:pom id="maven.project" file="${pom.xml}">
+ <remoteRepository id="${maven.repository.id}" url="${ivy_bootstrap_url1}" />
+ </artifact:pom>
<artifact:install file="${dist.jar.dir.prefix}-${version}/${dist.jar.dir.suffix}/${final.name}.jar">
<pom refid="maven.project"/>
</artifact:install>
@@ -1793,7 +1797,9 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
</mapper>
<path location="${ant.file}"/>
</pathconvert>
- <artifact:pom id="maven.project" file="${pom.xml}"/>
+ <artifact:pom id="maven.project" file="${pom.xml}">
+ <remoteRepository id="${maven.repository.id}" url="${ivy_bootstrap_url1}" />
+ </artifact:pom>
<artifact:install file="${dist.jar.dir.prefix}-${version}/${dist.jar.dir.suffix}/${final.name}.jar">
<pom refid="maven.project"/>
</artifact:install>
diff --git a/lucene/tools/src/groovy/run-maven-build.groovy b/lucene/tools/src/groovy/run-maven-build.groovy
deleted file mode 100644
index c26c7bf..0000000
--- a/lucene/tools/src/groovy/run-maven-build.groovy
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Task script that is called by Ant's build.xml file:
- * Runs maven build from within Ant after creating POMs.
- */
-
-import groovy.xml.NamespaceBuilder;
-import org.apache.tools.ant.Project;
-
-def userHome = properties['user.home'], commonDir = properties['common.dir'];
-def propPrefix = '-mvn.inject.'; int propPrefixLen = propPrefix.length();
-
-def subProject = project.createSubProject();
-project.copyUserProperties(subProject);
-subProject.initProperties();
-new AntBuilder(subProject).sequential{
- property(file: userHome+'/lucene.build.properties', prefix: propPrefix);
- property(file: userHome+'/build.properties', prefix: propPrefix);
- property(file: commonDir+'/build.properties', prefix: propPrefix);
-};
-
-def cmdlineProps = subProject.properties
- .findAll{ k, v -> k.startsWith(propPrefix) }
- .collectEntries{ k, v -> [k.substring(propPrefixLen), v] };
-cmdlineProps << project.userProperties.findAll{ k, v -> !k.startsWith('ant.') };
-
-def artifact = NamespaceBuilder.newInstance(ant, 'antlib:org.apache.maven.artifact.ant');
-
-task.log('Running Maven with props: ' + cmdlineProps.toString(), Project.MSG_INFO);
-artifact.mvn(pom: properties['maven-build-dir']+'/pom.xml', mavenVersion: properties['maven-version'], failonerror: true, fork: true) {
- cmdlineProps.each{ k, v -> arg(value: '-D' + k + '=' + v) };
- arg(value: '-fae');
- arg(value: 'install');
-};