Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D17D0200B7E for ; Mon, 22 Aug 2016 11:30:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CEC4F160AB3; Mon, 22 Aug 2016 09:30:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BDDAD160AD7 for ; Mon, 22 Aug 2016 11:30:01 +0200 (CEST) Received: (qmail 84149 invoked by uid 500); 22 Aug 2016 09:30:00 -0000 Mailing-List: contact commits-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list commits@karaf.apache.org Received: (qmail 83512 invoked by uid 99); 22 Aug 2016 09:30:00 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Aug 2016 09:30:00 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 67250E053F; Mon, 22 Aug 2016 09:30:00 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: jbonofre@apache.org To: commits@karaf.apache.org Date: Mon, 22 Aug 2016 09:30:32 -0000 Message-Id: <3790d062616a4a4baf629e2f753d0ce1@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [34/50] [abbrv] karaf git commit: [KARAF-4626] Properly transfer the system properties to the request archived-at: Mon, 22 Aug 2016 09:30:05 -0000 [KARAF-4626] Properly transfer the system properties to the request Project: http://git-wip-us.apache.org/repos/asf/karaf/repo Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/f9dd9999 Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/f9dd9999 Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/f9dd9999 Branch: refs/heads/master Commit: f9dd999917f30e012c40202bfb230ca90f27203b Parents: e6c8f20 Author: Roland Hauser Authored: Fri Jul 15 15:13:11 2016 +0200 Committer: Jean-Baptiste Onofré Committed: Mon Aug 22 11:29:21 2016 +0200 ---------------------------------------------------------------------- .../control.xml | 28 +++++++++++ .../feature/pom.xml | 52 ++++++++++++++++++++ .../pom.xml | 33 +++++++++++++ .../transitive/pom.xml | 49 ++++++++++++++++++ .../verify.bsh | 35 +++++++++++++ .../features/GenerateDescriptorMojo.java | 5 ++ 6 files changed, 202 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/karaf/blob/f9dd9999/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/control.xml ---------------------------------------------------------------------- diff --git a/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/control.xml b/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/control.xml new file mode 100644 index 0000000..131f23f --- /dev/null +++ b/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/control.xml @@ -0,0 +1,28 @@ + + + + + + mvn:test/transitive/[0.9,1.9) + mvn:org.apache.commons/commons-lang3/[3.0,3.4) + + + + http://git-wip-us.apache.org/repos/asf/karaf/blob/f9dd9999/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/feature/pom.xml ---------------------------------------------------------------------- diff --git a/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/feature/pom.xml b/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/feature/pom.xml new file mode 100644 index 0000000..f6d3f1e --- /dev/null +++ b/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/feature/pom.xml @@ -0,0 +1,52 @@ + + + + + + 4.0.0 + + test + feature + 1.0-SNAPSHOT + feature + + + + test + transitive + [0.9,1.9) + + + + + + + org.apache.karaf.tooling + karaf-maven-plugin + @pom.version@ + true + + true + true + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/karaf/blob/f9dd9999/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/pom.xml ---------------------------------------------------------------------- diff --git a/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/pom.xml b/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/pom.xml new file mode 100644 index 0000000..117cd73 --- /dev/null +++ b/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/pom.xml @@ -0,0 +1,33 @@ + + + + + + 4.0.0 + + test + test-feature-use-version-range-transfer-properties + 1.0-SNAPSHOT + pom + + + transitive + feature + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/karaf/blob/f9dd9999/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/transitive/pom.xml ---------------------------------------------------------------------- diff --git a/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/transitive/pom.xml b/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/transitive/pom.xml new file mode 100644 index 0000000..37c2443 --- /dev/null +++ b/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/transitive/pom.xml @@ -0,0 +1,49 @@ + + + + + + 4.0.0 + + test + transitive + 1.0-SNAPSHOT + bundle + + + + org.apache.commons + commons-lang3 + [3.0,3.4) + + + + + + + 1.8 + + + + + true + org.apache.felix + maven-bundle-plugin + 3.0.1 + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/karaf/blob/f9dd9999/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/verify.bsh ---------------------------------------------------------------------- diff --git a/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/verify.bsh b/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/verify.bsh new file mode 100644 index 0000000..1400502 --- /dev/null +++ b/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/verify.bsh @@ -0,0 +1,35 @@ +/* + * 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. + */ + +import org.custommonkey.xmlunit.*; +import java.io.*; +import java.lang.*; + +Reader r = new FileReader(new File(basedir, "control.xml")); + +// load the features file pushed to the repository +File generated = new File(basedir, "feature/target/feature/feature.xml" ); +if (generated.exists()) { + try { + XMLAssert.assertXMLEqual(r, new FileReader(generated)); + return true; + } catch (Throwable ignored) { } +} + +return false; http://git-wip-us.apache.org/repos/asf/karaf/blob/f9dd9999/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java ---------------------------------------------------------------------- diff --git a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java index a738bad..bba5e55 100644 --- a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java +++ b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java @@ -322,6 +322,11 @@ public class GenerateDescriptorMojo extends MojoSupport { resolvedProject = resolvedProjects.get(artifact); if (resolvedProject == null) { final ProjectBuildingRequest request = new DefaultProjectBuildingRequest(); + + // Fixes KARAF-4626; if the system properties are not transferred to the request, + // test-feature-use-version-range-transfer-properties will fail + request.setSystemProperties(System.getProperties()); + request.setResolveDependencies(true); request.setRemoteRepositories(project.getPluginArtifactRepositories()); request.setLocalRepository(localRepo);