This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch doxia-2.0.0
in repository https://gitbox.apache.org/repos/asf/maven-reporting-exec.git
The following commit(s) were added to refs/heads/doxia-2.0.0 by this push:
new 2d74300 Bump
2d74300 is described below
commit 2d7430042c516e8ce19841f64d82aff1038dac22
Author: Michael Osipov <[email protected]>
AuthorDate: Sun Apr 17 11:27:59 2022 +0200
Bump
---
pom.xml | 18 +--
src/it/forked-lifecycle/pom.xml | 2 +-
src/it/reportConfig/pom.xml | 2 +-
.../exec/DefaultMavenPluginManagerHelper.java | 4 -
.../reporting/exec/DefaultMavenReportExecutor.java | 125 +++++++++++----------
.../reporting/exec/MavenReportExecutorRequest.java | 5 +-
src/site/site.xml | 2 +-
.../exec/TestDefaultMavenReportExecutor.java | 14 +--
8 files changed, 79 insertions(+), 93 deletions(-)
diff --git a/pom.xml b/pom.xml
index 916c704..c64a5b9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,7 +46,7 @@
</issueManagement>
<ciManagement>
<system>Jenkins</system>
-
<url>https://ci-builds.apache.org/job/Maven/job/maven-box/job/maven-reporting-exec/</url>
+
<url>https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-reporting-exec/</url>
</ciManagement>
<distributionManagement>
<site>
@@ -56,9 +56,10 @@
</distributionManagement>
<properties>
+ <javaVersion>8</javaVersion>
<mavenVersion>3.2.5</mavenVersion>
<aetherVersion>1.0.0.v20140518</aetherVersion>
- <javaVersion>8</javaVersion>
+ <slf4jVersion>1.7.36</slf4jVersion>
<project.build.outputTimestamp>2022-02-10T08:20:39Z</project.build.outputTimestamp>
<sitePluginVersion>3.11.0</sitePluginVersion>
<projectInfoReportsPluginVersion>3.2.2</projectInfoReportsPluginVersion>
@@ -68,7 +69,7 @@
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-M1-SNAPSHOT</version>
</dependency>
<!-- Maven -->
@@ -117,10 +118,11 @@
<artifactId>plexus-utils</artifactId>
<version>3.1.0</version><!-- do not upgrade to 3.2.0+ because it adds
Xpp3Dom.getInputLocation(): see MSHARED-921 -->
</dependency>
+
<dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-classworlds</artifactId>
- <version>2.6.0</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4jVersion}</version>
</dependency>
<!-- Eclipse Aether for Maven 3.1+ -->
@@ -158,7 +160,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
- <version>1.7.32</version>
+ <version>${slf4jVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -334,8 +336,6 @@
<properties>
<maven.compiler.source>${maven.compiler.source}</maven.compiler.source>
<maven.compiler.target>${maven.compiler.target}</maven.compiler.target>
- <!-- e.g. ensure that Java7 picks up TLSv1.2 when connecting with
Central -->
- <https.protocols>${https.protocols}</https.protocols>
</properties>
</configuration>
<executions>
diff --git a/src/it/forked-lifecycle/pom.xml b/src/it/forked-lifecycle/pom.xml
index 1e14926..d739dad 100644
--- a/src/it/forked-lifecycle/pom.xml
+++ b/src/it/forked-lifecycle/pom.xml
@@ -65,7 +65,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>3.3.1</version>
+ <version>3.4.0</version>
</plugin>
</plugins>
</reporting>
diff --git a/src/it/reportConfig/pom.xml b/src/it/reportConfig/pom.xml
index ee04529..ff43213 100644
--- a/src/it/reportConfig/pom.xml
+++ b/src/it/reportConfig/pom.xml
@@ -42,7 +42,7 @@ under the License.
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
- <version>3.1.0</version>
+ <version>4.0.0-M1-SNAPSHOT</version>
</dependency>
</dependencies>
diff --git
a/src/main/java/org/apache/maven/reporting/exec/DefaultMavenPluginManagerHelper.java
b/src/main/java/org/apache/maven/reporting/exec/DefaultMavenPluginManagerHelper.java
index e1c6ecc..e24ae3b 100644
---
a/src/main/java/org/apache/maven/reporting/exec/DefaultMavenPluginManagerHelper.java
+++
b/src/main/java/org/apache/maven/reporting/exec/DefaultMavenPluginManagerHelper.java
@@ -31,7 +31,6 @@ import org.apache.maven.plugin.PluginResolutionException;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.logging.Logger;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.graph.DependencyFilter;
import org.eclipse.aether.repository.RemoteRepository;
@@ -44,9 +43,6 @@ import
org.eclipse.aether.util.filter.ExclusionsDependencyFilter;
public class DefaultMavenPluginManagerHelper
implements MavenPluginManagerHelper
{
- @Requirement
- private Logger logger;
-
@Requirement
protected MavenPluginManager mavenPluginManager;
diff --git
a/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java
b/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java
index 1d53bc5..3f57bc1 100644
---
a/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java
+++
b/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java
@@ -50,9 +50,10 @@ import org.apache.maven.shared.utils.StringUtils;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.configuration.PlexusConfiguration;
-import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.codehaus.plexus.util.xml.Xpp3DomUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* <p>
@@ -98,8 +99,7 @@ import org.codehaus.plexus.util.xml.Xpp3DomUtils;
public class DefaultMavenReportExecutor
implements MavenReportExecutor
{
- @Requirement
- private Logger logger;
+ private static final Logger LOGGER = LoggerFactory.getLogger(
DefaultMavenReportExecutor.class );
@Requirement
protected MavenPluginManager mavenPluginManager;
@@ -137,7 +137,6 @@ public class DefaultMavenReportExecutor
{
return Collections.emptyList();
}
- getLog().debug( "DefaultMavenReportExecutor.buildMavenReports()" );
Set<String> reportPluginKeys = new HashSet<>();
List<MavenReportExecution> reportExecutions = new ArrayList<>();
@@ -151,7 +150,7 @@ public class DefaultMavenReportExecutor
if ( !reportPluginKeys.add( pluginKey ) )
{
- logger.info( "plugin " + pluginKey + " will be executed
more than one time" );
+ LOGGER.info( "Plugin {} will be executed more than one
time", pluginKey );
}
reportExecutions.addAll( buildReportPlugin(
mavenReportExecutorRequest, reportPlugin ) );
@@ -159,7 +158,7 @@ public class DefaultMavenReportExecutor
}
catch ( Exception e )
{
- throw new MojoExecutionException( "failed to get report for " +
pluginKey, e );
+ throw new MojoExecutionException( "Failed to get report for " +
pluginKey, e );
}
return reportExecutions;
@@ -174,7 +173,7 @@ public class DefaultMavenReportExecutor
plugin.setGroupId( reportPlugin.getGroupId() );
plugin.setArtifactId( reportPlugin.getArtifactId() );
plugin.setVersion( resolvePluginVersion( reportPlugin,
mavenReportExecutorRequest ) );
- logger.info( "configuring report plugin " + plugin.getId() );
+ LOGGER.info( "Configuring report plugin {}", plugin.getId() );
mergePluginToReportPlugin( mavenReportExecutorRequest, plugin,
reportPlugin );
@@ -211,9 +210,9 @@ public class DefaultMavenReportExecutor
}
buff.append( mre.getGoal() );
}
- logger.info( reports.size() + " report" + ( reports.size() > 1 ?
"s" : "" ) + " "
- + ( hasUserDefinedReports ? "configured" : "detected" ) + "
for " + plugin.getArtifactId() + ":"
- + plugin.getVersion() + ": " + buff );
+ LOGGER.info( "{} report{} {} for {}:{}: {}", reports.size(), (
reports.size() > 1 ? "s" : "" ),
+ ( hasUserDefinedReports ? "configured" : "detected" ),
plugin.getArtifactId(),
+ plugin.getVersion(), buff );
}
return reports;
@@ -245,7 +244,7 @@ public class DefaultMavenReportExecutor
}
else
{
- logger.warn( report + " report is declared twice in default
reports" );
+ LOGGER.warn( "{} report is declared twice in default reports",
report );
}
}
@@ -261,7 +260,7 @@ public class DefaultMavenReportExecutor
}
else
{
- logger.warn( report + " report is declared twice in " +
reportSet.getId() + " reportSet" );
+ LOGGER.warn( "{} report is declared twice in {}
reportSet", report, reportSet.getId() );
}
}
}
@@ -302,8 +301,9 @@ public class DefaultMavenReportExecutor
if ( hasUserDefinedReports )
{
// reports were explicitly written in the POM
- logger.warn( "ignoring " + mojoExecution.getPlugin().getId() +
':' + report.getGoal()
- + " goal since it is not a report: should be removed from
reporting configuration in POM" );
+ LOGGER.warn( "Ignoring {}:{}"
+ + " goal since it is not a report: should be removed from
reporting configuration in POM",
+ mojoExecution.getPlugin().getId(), report.getGoal() );
}
return null;
}
@@ -354,12 +354,12 @@ public class DefaultMavenReportExecutor
execution = "'" + mojoDescriptor.getExecuteGoal() + "' forked
goal execution";
}
- logger.info( "preparing " + reportDescription + " requires " +
execution );
+ LOGGER.info( "Preparing {} requires {}", reportDescription,
execution );
lifecycleExecutor.executeForkedExecutions( mojoExecution,
mavenReportExecutorRequest.getMavenSession() );
- logger.info( execution + " for " + reportDescription + "
preparation done" );
+ LOGGER.info( "{} for {} preparation done", execution,
reportDescription );
}
return mavenReportExecution;
@@ -385,7 +385,14 @@ public class DefaultMavenReportExecutor
}
catch ( ClassCastException e )
{
- getLog().warn( "skip ClassCastException " + e.getMessage() );
+ if ( LOGGER.isDebugEnabled() )
+ {
+ LOGGER.warn( "Skipping ClassCastException", e );
+ }
+ else
+ {
+ LOGGER.warn( "Skipping ClassCastException" );
+ }
return null;
}
catch ( PluginContainerException e )
@@ -397,11 +404,13 @@ public class DefaultMavenReportExecutor
if ( e.getCause() != null && e.getCause() instanceof
NoClassDefFoundError
&& e.getMessage().contains( "PluginRegistry" ) )
{
- getLog().warn( "skip NoClassDefFoundError with PluginRegistry
" );
- // too noisy, only in debug mode + e.getMessage() );
- if ( getLog().isDebugEnabled() )
+ if ( LOGGER.isDebugEnabled() )
+ {
+ LOGGER.warn( "Skipping NoClassDefFoundError with
PluginRegistry", e );
+ }
+ else
{
- getLog().debug( e.getMessage(), e );
+ LOGGER.warn( "Skipping NoClassDefFoundError with
PluginRegistry" );
}
return null;
}
@@ -424,8 +433,14 @@ public class DefaultMavenReportExecutor
}
catch ( ClassNotFoundException e )
{
- getLog().warn( "skip ClassNotFoundException mojoExecution.goal '"
+ mojoExecution.getGoal() + "': "
- + e.getMessage(), e );
+ if ( LOGGER.isDebugEnabled() )
+ {
+ LOGGER.warn( "Skipping ClassNotFoundException
mojoExecution.goal {}", mojoExecution.getGoal(), e );
+ }
+ else
+ {
+ LOGGER.warn( "Skipping ClassNotFoundException
mojoExecution.goal {}", mojoExecution.getGoal() );
+ }
return false;
}
finally
@@ -441,17 +456,17 @@ public class DefaultMavenReportExecutor
boolean isMavenReport = MavenReport.class.isAssignableFrom(
mojoClass );
- if ( getLog().isDebugEnabled() )
+ if ( LOGGER.isDebugEnabled() )
{
if ( mojoDescriptor != null &&
mojoDescriptor.getImplementationClass() != null )
{
- getLog().debug( "class " +
mojoDescriptor.getImplementationClass().getName() + " isMavenReport: "
- + isMavenReport );
+ LOGGER.debug( "Class {} is MavenReport: ",
+ mojoDescriptor.getImplementationClass().getName(),
isMavenReport );
}
if ( !isMavenReport )
{
- getLog().debug( "skip non MavenReport " +
mojoExecution.getMojoDescriptor().getId() );
+ LOGGER.debug( "Skipping non MavenReport {}",
mojoExecution.getMojoDescriptor().getId() );
}
}
@@ -459,8 +474,14 @@ public class DefaultMavenReportExecutor
}
catch ( LinkageError e )
{
- getLog().warn( "skip LinkageError mojoExecution.goal '" +
mojoExecution.getGoal() + "': " + e.getMessage(),
- e );
+ if ( LOGGER.isDebugEnabled() )
+ {
+ LOGGER.warn( "Skipping LinkageError mojoExecution.goal {}",
mojoExecution.getGoal(), e );
+ }
+ else
+ {
+ LOGGER.warn( "Skipping LinkageError mojoExecution.goal {}",
mojoExecution.getGoal() );
+ }
return false;
}
finally
@@ -539,11 +560,6 @@ public class DefaultMavenReportExecutor
return dom;
}
- private Logger getLog()
- {
- return logger;
- }
-
/**
* Resolve report plugin version. Steps to find a plugin version stop
after each step if a non <code>null</code>
* value has been found:
@@ -565,19 +581,13 @@ public class DefaultMavenReportExecutor
throws PluginVersionResolutionException
{
String reportPluginKey = reportPlugin.getGroupId() + ':' +
reportPlugin.getArtifactId();
- if ( getLog().isDebugEnabled() )
- {
- getLog().debug( "resolving version for " + reportPluginKey );
- }
+ LOGGER.debug( "Resolving version for {}", reportPluginKey );
// look for version defined in the reportPlugin configuration
if ( reportPlugin.getVersion() != null )
{
- if ( getLog().isDebugEnabled() )
- {
- logger.debug( "resolved " + reportPluginKey + " version from
the reporting.plugins section: "
- + reportPlugin.getVersion() );
- }
+ LOGGER.debug( "Resolved {} version from the reporting.plugins
section: {}",
+ reportPluginKey, reportPlugin.getVersion() );
return reportPlugin.getVersion();
}
@@ -590,11 +600,8 @@ public class DefaultMavenReportExecutor
if ( plugin != null && plugin.getVersion() != null )
{
- if ( getLog().isDebugEnabled() )
- {
- logger.debug( "resolved " + reportPluginKey + " version
from the build.plugins section: "
- + plugin.getVersion() );
- }
+ LOGGER.debug( "Resolved {} version from the build.plugins
section: {}",
+ reportPluginKey, plugin.getVersion() );
return plugin.getVersion();
}
}
@@ -606,21 +613,18 @@ public class DefaultMavenReportExecutor
if ( plugin != null && plugin.getVersion() != null )
{
- if ( getLog().isDebugEnabled() )
- {
- logger.debug( "resolved " + reportPluginKey
- + " version from the build.pluginManagement.plugins
section: " + plugin.getVersion() );
- }
+ LOGGER.debug( "Resolved {} version from the
build.pluginManagement.plugins section: {}",
+ reportPluginKey, plugin.getVersion() );
return plugin.getVersion();
}
}
- logger.warn( "Report plugin " + reportPluginKey + " has an empty
version." );
- logger.warn( "" );
- logger.warn( "It is highly recommended to fix these problems"
+ LOGGER.warn( "Report plugin {} has an empty version.", reportPluginKey
);
+ LOGGER.warn( "" );
+ LOGGER.warn( "It is highly recommended to fix these problems"
+ " because they threaten the stability of your build." );
- logger.warn( "" );
- logger.warn( "For this reason, future Maven versions might no"
+ LOGGER.warn( "" );
+ LOGGER.warn( "For this reason, future Maven versions might no"
+ " longer support building such malformed projects." );
Plugin plugin = new Plugin();
@@ -631,10 +635,7 @@ public class DefaultMavenReportExecutor
new DefaultPluginVersionRequest( plugin,
mavenReportExecutorRequest.getMavenSession() );
PluginVersionResult result = pluginVersionResolver.resolve(
pluginVersionRequest );
- if ( getLog().isDebugEnabled() )
- {
- getLog().debug( "resolved " + reportPluginKey + " version from
repository: " + result.getVersion() );
- }
+ LOGGER.debug( "Resolved {} version from repository: {}",
reportPluginKey, result.getVersion() );
return result.getVersion();
}
diff --git
a/src/main/java/org/apache/maven/reporting/exec/MavenReportExecutorRequest.java
b/src/main/java/org/apache/maven/reporting/exec/MavenReportExecutorRequest.java
index 6b595ce..7c9199c 100644
---
a/src/main/java/org/apache/maven/reporting/exec/MavenReportExecutorRequest.java
+++
b/src/main/java/org/apache/maven/reporting/exec/MavenReportExecutorRequest.java
@@ -29,11 +29,10 @@ import
org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
import org.codehaus.plexus.util.xml.Xpp3Dom;
/**
- * Bean which contains necessary informations to build {@link
MavenReportExecution} with {@link MavenReportExecutor}:
+ * Bean which contains necessary informations to build {@link
MavenReportExecution} with {@link MavenReportExecutor}:
* the intent is to store some informations regarding the current Maven
execution.
- *
+ *
* @author Olivier Lamy
- * @version $Id$
*/
public class MavenReportExecutorRequest
{
diff --git a/src/site/site.xml b/src/site/site.xml
index 699f845..f30aab5 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -25,7 +25,7 @@ under the License.
<body>
<menu name="Overview">
<item name="Introduction" href="index.html"/>
- <item name="JavaDocs" href="apidocs/index.html"/>
+ <item name="Javadoc" href="apidocs/index.html"/>
<item name="Source Xref" href="xref/index.html"/>
<!--item name="FAQ" href="faq.html"/-->
<!-- According to https://issues.apache.org/jira/browse/MNGSITE-152 -->
diff --git
a/src/test/java/org/apache/maven/reporting/exec/TestDefaultMavenReportExecutor.java
b/src/test/java/org/apache/maven/reporting/exec/TestDefaultMavenReportExecutor.java
index bd5921b..8a2142a 100644
---
a/src/test/java/org/apache/maven/reporting/exec/TestDefaultMavenReportExecutor.java
+++
b/src/test/java/org/apache/maven/reporting/exec/TestDefaultMavenReportExecutor.java
@@ -48,7 +48,6 @@ import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.classworlds.realm.ClassRealm;
import
org.codehaus.plexus.component.repository.exception.ComponentLookupException;
-import org.codehaus.plexus.logging.Logger;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.repository.RemoteRepository;
@@ -129,7 +128,7 @@ public class TestDefaultMavenReportExecutor
Plugin plugin = new Plugin();
plugin.setGroupId( "org.apache.maven.plugins" );
plugin.setArtifactId( "maven-javadoc-plugin" );
- plugin.setVersion( "3.3.3-SNAPSHOT" );
+ plugin.setVersion( "3.4.0" );
Dependency dependency = new Dependency();
dependency.setGroupId( "commons-lang" );
dependency.setArtifactId( "commons-lang" );
@@ -170,7 +169,7 @@ public class TestDefaultMavenReportExecutor
ReportPlugin reportPlugin = new ReportPlugin();
reportPlugin.setGroupId( "org.apache.maven.plugins" );
reportPlugin.setArtifactId( "maven-javadoc-plugin" );
- reportPlugin.setVersion( "3.3.3-SNAPSHOT" );
+ reportPlugin.setVersion( "3.4.0" );
for ( ReportSet reportSet : javadocReportSets )
{
@@ -219,12 +218,6 @@ public class TestDefaultMavenReportExecutor
} );
final Settings settings = getSettings();
- Mirror centralMirror = new Mirror();
- centralMirror.setId("httpsCentral");
- centralMirror.setMirrorOf( "central" );
- centralMirror.setUrl( "https://repo.maven.apache.org/maven2" );
- request.setMirrors( Collections.singletonList( centralMirror ) );
-
getContainer().lookup( MavenExecutionRequestPopulator.class
).populateFromSettings( request, settings );
getContainer().lookup( MavenExecutionRequestPopulator.class
).populateDefaults( request );
@@ -233,9 +226,6 @@ public class TestDefaultMavenReportExecutor
request.setLocalRepositoryPath(
getLocalArtifactRepository().getBasedir() );
request.setCacheNotFound( false );
- request.setLoggingLevel( MavenExecutionRequest.LOGGING_LEVEL_INFO );
- getContainer().lookup( Logger.class ).setThreshold( 1 );
-
request.setSystemProperties( System.getProperties() );
MavenExecutionResult result = new DefaultMavenExecutionResult();