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 2022/05/18 08:33:47 UTC

[maven-site-plugin] branch maven-site-plugin-3.x updated: [MSITE-901] If precending standalone report has been run, site:jar does not reinvoke site:site

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

michaelo pushed a commit to branch maven-site-plugin-3.x
in repository https://gitbox.apache.org/repos/asf/maven-site-plugin.git


The following commit(s) were added to refs/heads/maven-site-plugin-3.x by this push:
     new bd3376f5 [MSITE-901] If precending standalone report has been run, site:jar does not reinvoke site:site
bd3376f5 is described below

commit bd3376f52d0053e05c78327aad39353710702a7a
Author: Matt Nelson <ma...@cerner.com>
AuthorDate: Fri Mar 20 18:05:04 2020 -0500

    [MSITE-901] If precending standalone report has been run, site:jar does not reinvoke site:site
    
    This closes #82
---
 src/it/projects/MSITE-901/invoker.properties       | 18 +++++
 src/it/projects/MSITE-901/pom.xml                  | 78 ++++++++++++++++++++++
 src/it/projects/MSITE-901/verify.groovy            | 27 ++++++++
 .../maven/plugins/site/render/SiteJarMojo.java     |  7 +-
 4 files changed, 125 insertions(+), 5 deletions(-)

diff --git a/src/it/projects/MSITE-901/invoker.properties b/src/it/projects/MSITE-901/invoker.properties
new file mode 100644
index 00000000..a644cb7e
--- /dev/null
+++ b/src/it/projects/MSITE-901/invoker.properties
@@ -0,0 +1,18 @@
+# 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.goals = clean package
diff --git a/src/it/projects/MSITE-901/pom.xml b/src/it/projects/MSITE-901/pom.xml
new file mode 100644
index 00000000..a89260c7
--- /dev/null
+++ b/src/it/projects/MSITE-901/pom.xml
@@ -0,0 +1,78 @@
+<?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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugins.site.it</groupId>
+  <artifactId>MSITE-901</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+
+  <description>Verifies that the site:jar goal output is not altered by the pmd/cpd skipEmptyReport property</description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-pmd-plugin</artifactId>
+        <version>3.16.0</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>check</goal>
+            </goals>
+            <phase>process-sources</phase>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-site-plugin</artifactId>
+        <version>@project.version@</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <artifactId>maven-project-info-reports-plugin</artifactId>
+        <version>@projectInfoReportsPluginVersion@</version>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>index</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+    </plugins>
+  </reporting>
+
+</project>
diff --git a/src/it/projects/MSITE-901/verify.groovy b/src/it/projects/MSITE-901/verify.groovy
new file mode 100644
index 00000000..1cf15bed
--- /dev/null
+++ b/src/it/projects/MSITE-901/verify.groovy
@@ -0,0 +1,27 @@
+
+/*
+ * 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.
+ */
+
+File buildLog = new File( basedir, 'build.log' )
+assert buildLog.exists()
+
+File siteIndex = new File( basedir, 'target/site/index.html' )
+File sitePmd = new File( basedir, 'target/site/pmd.html' )
+assert siteIndex.exists()
+assert sitePmd.exists()
diff --git a/src/main/java/org/apache/maven/plugins/site/render/SiteJarMojo.java b/src/main/java/org/apache/maven/plugins/site/render/SiteJarMojo.java
index 26be6d40..8471aed9 100644
--- a/src/main/java/org/apache/maven/plugins/site/render/SiteJarMojo.java
+++ b/src/main/java/org/apache/maven/plugins/site/render/SiteJarMojo.java
@@ -45,7 +45,7 @@ import org.codehaus.plexus.archiver.jar.ManifestException;
  *
  * @since 2.0-beta-6
  */
-// MSITE-665: requiresDependencyResolution workaround for MPLUGIN-253 
+// MSITE-665: requiresDependencyResolution workaround for MPLUGIN-253
 @Mojo( name = "jar", defaultPhase = LifecyclePhase.PACKAGE, requiresDependencyResolution = ResolutionScope.TEST,
        requiresReports = true )
 public class SiteJarMojo
@@ -137,10 +137,7 @@ public class SiteJarMojo
             return;
         }
 
-        if ( !outputDirectory.exists() )
-        {
-            super.execute();
-        }
+        super.execute();
 
         try
         {