Skip to content

Commit

Permalink
[MSITE-901] If precending standalone report has been run, site:jar do…
Browse files Browse the repository at this point in the history
…es not reinvoke site:site

This closes #82
  • Loading branch information
mattnelson authored and michael-o committed May 18, 2022
1 parent b99c0ef commit bd3376f
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 5 deletions.
18 changes: 18 additions & 0 deletions src/it/projects/MSITE-901/invoker.properties
Original file line number Diff line number Diff line change
@@ -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
78 changes: 78 additions & 0 deletions src/it/projects/MSITE-901/pom.xml
Original file line number Diff line number Diff line change
@@ -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>
27 changes: 27 additions & 0 deletions src/it/projects/MSITE-901/verify.groovy
Original file line number Diff line number Diff line change
@@ -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()
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
*
* @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
Expand Down Expand Up @@ -137,10 +137,7 @@ public void execute()
return;
}

if ( !outputDirectory.exists() )
{
super.execute();
}
super.execute();

try
{
Expand Down

0 comments on commit bd3376f

Please sign in to comment.