This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch next-version
in repository https://gitbox.apache.org/repos/asf/maven-scm-publish-plugin.git

commit 19adf63b5cb8e6a532eb23a00a43ed8281d27c2f
Author: Michael Osipov <[email protected]>
AuthorDate: Sat Jun 15 23:46:40 2024 +0200

    [MSCMPUB-69] ITs do not properly check for existence of 
svn/svnadmin/CreateSymbolicLink command/function
---
 src/it/issue-mscmpub-50/invoker.properties |  3 --
 src/it/issue-mscmpub-50/selector.groovy    | 42 ++++++++++++++++++++++++++
 src/it/publish-scm-skip/invoker.properties |  3 --
 src/it/publish-scm-skip/selector.groovy    | 42 ++++++++++++++++++++++++++
 src/it/publish-scm-staged/selector.groovy  | 32 ++++++++++++++++++++
 src/it/publish-scm/invoker.properties      |  3 --
 src/it/publish-scm/selector.groovy         | 48 ++++++++++++++++++++++++++++++
 src/it/site-deploy/selector.groovy         | 32 ++++++++++++++++++++
 8 files changed, 196 insertions(+), 9 deletions(-)

diff --git a/src/it/issue-mscmpub-50/invoker.properties 
b/src/it/issue-mscmpub-50/invoker.properties
index eaa8afa..bf59692 100644
--- a/src/it/issue-mscmpub-50/invoker.properties
+++ b/src/it/issue-mscmpub-50/invoker.properties
@@ -16,6 +16,3 @@
 # under the License.
 
 invoker.goals = site scm-publish:publish-scm
-
-# Windows doesn't have svn and svnadmin executables
-invoker.os.family = !windows
diff --git a/src/it/issue-mscmpub-50/selector.groovy 
b/src/it/issue-mscmpub-50/selector.groovy
new file mode 100644
index 0000000..53e6e07
--- /dev/null
+++ b/src/it/issue-mscmpub-50/selector.groovy
@@ -0,0 +1,42 @@
+/*
+ * 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 java.nio.file.Files
+import java.nio.file.Path
+
+try {
+    def proc = "svnadmin".execute()
+    proc.consumeProcessOutput()
+    proc.waitFor()
+
+    def proc2 = "svn".execute()
+    proc2.consumeProcessOutput()
+    proc2.waitFor()
+
+    def pom = basedir.toPath().resolve("pom.xml")
+    def linkedPom = basedir.toPath().resolve("linked-pom.xml")
+    if (Files.exists(linkedPom)) {
+        Files.delete(linkedPom)
+    }
+    Files.createSymbolicLink(linkedPom, pom)
+} catch (IOException e) {
+    return false
+}
+
+return true
diff --git a/src/it/publish-scm-skip/invoker.properties 
b/src/it/publish-scm-skip/invoker.properties
index eaa8afa..bf59692 100644
--- a/src/it/publish-scm-skip/invoker.properties
+++ b/src/it/publish-scm-skip/invoker.properties
@@ -16,6 +16,3 @@
 # under the License.
 
 invoker.goals = site scm-publish:publish-scm
-
-# Windows doesn't have svn and svnadmin executables
-invoker.os.family = !windows
diff --git a/src/it/publish-scm-skip/selector.groovy 
b/src/it/publish-scm-skip/selector.groovy
new file mode 100644
index 0000000..53e6e07
--- /dev/null
+++ b/src/it/publish-scm-skip/selector.groovy
@@ -0,0 +1,42 @@
+/*
+ * 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 java.nio.file.Files
+import java.nio.file.Path
+
+try {
+    def proc = "svnadmin".execute()
+    proc.consumeProcessOutput()
+    proc.waitFor()
+
+    def proc2 = "svn".execute()
+    proc2.consumeProcessOutput()
+    proc2.waitFor()
+
+    def pom = basedir.toPath().resolve("pom.xml")
+    def linkedPom = basedir.toPath().resolve("linked-pom.xml")
+    if (Files.exists(linkedPom)) {
+        Files.delete(linkedPom)
+    }
+    Files.createSymbolicLink(linkedPom, pom)
+} catch (IOException e) {
+    return false
+}
+
+return true
diff --git a/src/it/publish-scm-staged/selector.groovy 
b/src/it/publish-scm-staged/selector.groovy
new file mode 100644
index 0000000..ab83e41
--- /dev/null
+++ b/src/it/publish-scm-staged/selector.groovy
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+try {
+    def proc = "svnadmin".execute()
+    proc.consumeProcessOutput()
+    proc.waitFor()
+
+    def proc2 = "svn".execute()
+    proc2.consumeProcessOutput()
+    proc2.waitFor()
+} catch (IOException e) {
+    return false
+}
+
+return true
diff --git a/src/it/publish-scm/invoker.properties 
b/src/it/publish-scm/invoker.properties
index eaa8afa..bf59692 100644
--- a/src/it/publish-scm/invoker.properties
+++ b/src/it/publish-scm/invoker.properties
@@ -16,6 +16,3 @@
 # under the License.
 
 invoker.goals = site scm-publish:publish-scm
-
-# Windows doesn't have svn and svnadmin executables
-invoker.os.family = !windows
diff --git a/src/it/publish-scm/selector.groovy 
b/src/it/publish-scm/selector.groovy
new file mode 100644
index 0000000..2f1b480
--- /dev/null
+++ b/src/it/publish-scm/selector.groovy
@@ -0,0 +1,48 @@
+/*
+ * 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 java.nio.file.Files
+import java.nio.file.Path
+import java.util.Locale
+
+try {
+    def proc = "svnadmin".execute()
+    proc.consumeProcessOutput()
+    proc.waitFor()
+
+    def proc2 = "svn".execute()
+    proc2.consumeProcessOutput()
+    proc2.waitFor()
+
+    def pom = basedir.toPath().resolve("pom.xml")
+    def linkedPom = basedir.toPath().resolve("linked-pom.xml")
+    if (Files.exists(linkedPom)) {
+        Files.delete(linkedPom)
+    }
+    Files.createSymbolicLink(linkedPom, pom)
+} catch (IOException e) {
+    return false
+}
+
+// Because of a bug in Subversion on Windows
+if (System.properties['os.name'].toLowerCase(Locale.ROOT).contains('windows')) 
{
+    return false
+}
+
+return true
diff --git a/src/it/site-deploy/selector.groovy 
b/src/it/site-deploy/selector.groovy
new file mode 100644
index 0000000..ab83e41
--- /dev/null
+++ b/src/it/site-deploy/selector.groovy
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+try {
+    def proc = "svnadmin".execute()
+    proc.consumeProcessOutput()
+    proc.waitFor()
+
+    def proc2 = "svn".execute()
+    proc2.consumeProcessOutput()
+    proc2.waitFor()
+} catch (IOException e) {
+    return false
+}
+
+return true

Reply via email to