desruisseaux commented on code in PR #612:
URL: https://github.com/apache/maven-jar-plugin/pull/612#discussion_r4114999332


##########
src/it/mjar-138/verify.groovy:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+// MJAR-138: -DskipTests must NOT prevent the test-jar from being built.
+// The model module's test-jar must be produced so the client module can
+// resolve it as a reactor artifact and compile its test sources against it.
+
+import java.io.*;
+
+boolean result = true;
+
+try {
+    // 1. The model test-jar must have been produced despite -DskipTests.
+    File testJar = new File(basedir, 
"model/target/model-1.0-SNAPSHOT-tests.jar");
+    if (!testJar.exists() || testJar.isDirectory()) {

Review Comment:
   The two conditions can be replaced by `!testJar.isFile()`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to