Skip to content

Commit bd3376f

Browse files
mattnelsonmichael-o
authored andcommitted
[MSITE-901] If precending standalone report has been run, site:jar does not reinvoke site:site
This closes #82
1 parent b99c0ef commit bd3376f

File tree

4 files changed

+125
-5
lines changed

4 files changed

+125
-5
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
invoker.goals = clean package

src/it/projects/MSITE-901/pom.xml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
-->
21+
22+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24+
<modelVersion>4.0.0</modelVersion>
25+
26+
<groupId>org.apache.maven.plugins.site.it</groupId>
27+
<artifactId>MSITE-901</artifactId>
28+
<version>1.0.0-SNAPSHOT</version>
29+
30+
<description>Verifies that the site:jar goal output is not altered by the pmd/cpd skipEmptyReport property</description>
31+
32+
<build>
33+
<plugins>
34+
<plugin>
35+
<groupId>org.apache.maven.plugins</groupId>
36+
<artifactId>maven-pmd-plugin</artifactId>
37+
<version>3.16.0</version>
38+
<executions>
39+
<execution>
40+
<goals>
41+
<goal>check</goal>
42+
</goals>
43+
<phase>process-sources</phase>
44+
</execution>
45+
</executions>
46+
</plugin>
47+
<plugin>
48+
<groupId>org.apache.maven.plugins</groupId>
49+
<artifactId>maven-site-plugin</artifactId>
50+
<version>@project.version@</version>
51+
<executions>
52+
<execution>
53+
<goals>
54+
<goal>jar</goal>
55+
</goals>
56+
</execution>
57+
</executions>
58+
</plugin>
59+
</plugins>
60+
</build>
61+
62+
<reporting>
63+
<plugins>
64+
<plugin>
65+
<artifactId>maven-project-info-reports-plugin</artifactId>
66+
<version>@projectInfoReportsPluginVersion@</version>
67+
<reportSets>
68+
<reportSet>
69+
<reports>
70+
<report>index</report>
71+
</reports>
72+
</reportSet>
73+
</reportSets>
74+
</plugin>
75+
</plugins>
76+
</reporting>
77+
78+
</project>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
/*
3+
* Licensed to the Apache Software Foundation (ASF) under one
4+
* or more contributor license agreements. See the NOTICE file
5+
* distributed with this work for additional information
6+
* regarding copyright ownership. The ASF licenses this file
7+
* to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing,
14+
* software distributed under the License is distributed on an
15+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
* KIND, either express or implied. See the License for the
17+
* specific language governing permissions and limitations
18+
* under the License.
19+
*/
20+
21+
File buildLog = new File( basedir, 'build.log' )
22+
assert buildLog.exists()
23+
24+
File siteIndex = new File( basedir, 'target/site/index.html' )
25+
File sitePmd = new File( basedir, 'target/site/pmd.html' )
26+
assert siteIndex.exists()
27+
assert sitePmd.exists()

src/main/java/org/apache/maven/plugins/site/render/SiteJarMojo.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
*
4646
* @since 2.0-beta-6
4747
*/
48-
// MSITE-665: requiresDependencyResolution workaround for MPLUGIN-253
48+
// MSITE-665: requiresDependencyResolution workaround for MPLUGIN-253
4949
@Mojo( name = "jar", defaultPhase = LifecyclePhase.PACKAGE, requiresDependencyResolution = ResolutionScope.TEST,
5050
requiresReports = true )
5151
public class SiteJarMojo
@@ -137,10 +137,7 @@ public void execute()
137137
return;
138138
}
139139

140-
if ( !outputDirectory.exists() )
141-
{
142-
super.execute();
143-
}
140+
super.execute();
144141

145142
try
146143
{

0 commit comments

Comments
 (0)