You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2021/04/03 21:56:22 UTC

[maven-source-plugin] 01/02: [MSOURCES-121] - Check for duplicated addition of the same file - Added IT to check for failing in case of executing twice.

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

slachiewicz pushed a commit to branch MSOURCES-121
in repository https://gitbox.apache.org/repos/asf/maven-source-plugin.git

commit 7b7d37d7c8e1a0f9ab9a8db4ebee6d1592760c2b
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sun May 19 16:27:49 2019 +0200

    [MSOURCES-121] - Check for duplicated addition of the same file
     - Added IT to check for failing in case of executing twice.
---
 src/it/MSOURCES-121/invoker.properties             | 17 ++++++
 src/it/MSOURCES-121/pom.xml                        | 65 ++++++++++++++++++++++
 src/it/MSOURCES-121/src/main/java/MyClass.java     | 23 ++++++++
 .../src/main/resources/main.properties             | 17 ++++++
 src/it/MSOURCES-121/src/test/java/MyTest.java      | 23 ++++++++
 .../src/test/resources/test.properties             | 17 ++++++
 6 files changed, 162 insertions(+)

diff --git a/src/it/MSOURCES-121/invoker.properties b/src/it/MSOURCES-121/invoker.properties
new file mode 100644
index 0000000..2668a60
--- /dev/null
+++ b/src/it/MSOURCES-121/invoker.properties
@@ -0,0 +1,17 @@
+# 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.
+invoker.buildResult = failure
diff --git a/src/it/MSOURCES-121/pom.xml b/src/it/MSOURCES-121/pom.xml
new file mode 100644
index 0000000..f1274f9
--- /dev/null
+++ b/src/it/MSOURCES-121/pom.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.sources</groupId>
+  <artifactId>jar-no-fork</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>Test for multiple attachments of files</name>
+	<description>This build should fail based on the duplicate
+   execution with  the same configuration. This will errornously
+   add the classifier/file twice times.
+   MSOURCES-121.
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <version>@project.version@</version>
+        <executions>
+          <execution>
+            <id>attach-sources-1</id>
+            <goals>
+              <goal>jar-no-fork</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>attach-sources-2</id>
+            <goals>
+              <goal>jar-no-fork</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/src/it/MSOURCES-121/src/main/java/MyClass.java b/src/it/MSOURCES-121/src/main/java/MyClass.java
new file mode 100644
index 0000000..4945381
--- /dev/null
+++ b/src/it/MSOURCES-121/src/main/java/MyClass.java
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+public class MyClass
+{
+
+}
diff --git a/src/it/MSOURCES-121/src/main/resources/main.properties b/src/it/MSOURCES-121/src/main/resources/main.properties
new file mode 100644
index 0000000..00ae6c0
--- /dev/null
+++ b/src/it/MSOURCES-121/src/main/resources/main.properties
@@ -0,0 +1,17 @@
+# 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.
+
diff --git a/src/it/MSOURCES-121/src/test/java/MyTest.java b/src/it/MSOURCES-121/src/test/java/MyTest.java
new file mode 100644
index 0000000..9d124be
--- /dev/null
+++ b/src/it/MSOURCES-121/src/test/java/MyTest.java
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+public class MyTest
+{
+
+}
diff --git a/src/it/MSOURCES-121/src/test/resources/test.properties b/src/it/MSOURCES-121/src/test/resources/test.properties
new file mode 100644
index 0000000..00ae6c0
--- /dev/null
+++ b/src/it/MSOURCES-121/src/test/resources/test.properties
@@ -0,0 +1,17 @@
+# 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.
+