You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2024/06/16 19:46:34 UTC
(maven-scm-publish-plugin) 01/01: [MSCMPUB-69] ITs do not properly check for existence of svn/svnadmin/CreateSymbolicLink command/function
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 12afe10656fe528ba7d57c7fe24571d1e3feeda6
Author: Michael Osipov <mi...@apache.org>
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 | 40 ++++++++++++++++++++++++++
src/it/publish-scm-skip/invoker.properties | 3 --
src/it/publish-scm-skip/selector.groovy | 40 ++++++++++++++++++++++++++
src/it/publish-scm-staged/selector.groovy | 32 +++++++++++++++++++++
src/it/publish-scm/invoker.properties | 3 --
src/it/publish-scm/selector.groovy | 46 ++++++++++++++++++++++++++++++
src/it/site-deploy/selector.groovy | 32 +++++++++++++++++++++
8 files changed, 190 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..87a770c
--- /dev/null
+++ b/src/it/issue-mscmpub-50/selector.groovy
@@ -0,0 +1,40 @@
+/*
+ * 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")
+ Files.deleteIfExists(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..87a770c
--- /dev/null
+++ b/src/it/publish-scm-skip/selector.groovy
@@ -0,0 +1,40 @@
+/*
+ * 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")
+ Files.deleteIfExists(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..12ac4d1
--- /dev/null
+++ b/src/it/publish-scm/selector.groovy
@@ -0,0 +1,46 @@
+/*
+ * 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")
+ Files.deleteIfExists(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