You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 10:20:31 UTC
[sling-org-apache-sling-testing-paxexam] 02/39: SLING-6038 Provide
convenient method to set versions from Maven project
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.testing.paxexam-0.0.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-paxexam.git
commit 1d050e7cfaa1e51dcd5fdef172b26883c7519bc0
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Sep 5 19:28:38 2016 +0000
SLING-6038 Provide convenient method to set versions from Maven project
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/org.apache.sling.testing.paxexam@1759346 13f79535-47bb-0310-9956-ffa450edef68
---
.../testing/paxexam/SlingVersionResolver.java | 6 ++++++
.../apache/sling/testing/paxexam/package-info.java | 22 ++++++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/src/main/java/org/apache/sling/testing/paxexam/SlingVersionResolver.java b/src/main/java/org/apache/sling/testing/paxexam/SlingVersionResolver.java
index 757e2aa..44e43ed 100644
--- a/src/main/java/org/apache/sling/testing/paxexam/SlingVersionResolver.java
+++ b/src/main/java/org/apache/sling/testing/paxexam/SlingVersionResolver.java
@@ -21,6 +21,7 @@ package org.apache.sling.testing.paxexam;
import java.util.HashMap;
import java.util.Map;
+import org.ops4j.pax.exam.MavenUtils;
import org.ops4j.pax.exam.options.MavenUrlReference.VersionResolver;
/**
@@ -201,6 +202,11 @@ public class SlingVersionResolver implements VersionResolver {
return versions.put(key(groupId, artifactId), version);
}
+ public String setVersionFromProject(final String groupId, final String artifactId) {
+ final String version = MavenUtils.getArtifactVersion(groupId, artifactId);
+ return versions.put(key(groupId, artifactId), version);
+ }
+
@Override
public String getVersion(final String groupId, final String artifactId) {
return versions.get(key(groupId, artifactId));
diff --git a/src/main/java/org/apache/sling/testing/paxexam/package-info.java b/src/main/java/org/apache/sling/testing/paxexam/package-info.java
new file mode 100644
index 0000000..1d9843a
--- /dev/null
+++ b/src/main/java/org/apache/sling/testing/paxexam/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+@Version("0.1.0")
+package org.apache.sling.testing.paxexam;
+
+import org.osgi.annotation.versioning.Version;
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.