Greetings,
After being inspired by another thread, I decided to create a build
extension. All it does right now is cut a message to the log:
@Component(role = AbstractMavenLifecycleParticipant.class)
public final class BannerExtension extends AbstractMavenLifecycleParticipant
{
@Requirement private RuntimeInformation runtime;
@Requirement private Logger logger;
@Override
public void afterProjectsRead(final MavenSession session) {
if (logger.isInfoEnabled())
{ logger.info("RUNTIME: " + runtime.getApplicationVersion()); }
}
}
Most of the time it works just fine, however sometimes after I have
mvn clean previously, I will take an exception in the log on the next
mvn invocation:
[WARNING] Failed to retrieve plugin descriptor for
com.acme.maven.extensions:banner-maven-extension:0.1: Failed to parse
plugin descriptor for
com.acme.maven.extensions:banner-maven-extension:0.1
($HOME/.m2/repository/com/acme/maven/extensions/banner-maven-extension/0.1/banner-maven-extension-0.1.jar):
No plugin descriptor found at META-INF/maven/plugin.xml
However, I have followed the documentation
http://maven.apache.org/examples/maven-3-lifecycle-extensions.html and
the extension pom generates both the metadata and test-metadata
(though no META-INF/maven/plugin.xml is created), and I find
META-INF/plugins/components.xml with:
<?xml version="1.0" encoding="UTF-8"?>
<component-set>
<components>
<component>
<role>org.apache.maven.AbstractMavenLifecycleParticipant</role>
<role-hint>default</role-hint>
<implementation>com.acme.maven.extensions.BannerExtension</implementation>
<description />
<isolated-realm>false</isolated-realm>
<requirements>
<requirement>
<role>org.codehaus.plexus.logging.Logger</role>
<role-hint />
<field-name>logger</field-name>
</requirement>
<requirement>
<role>org.apache.maven.execution.RuntimeInformation</role>
<role-hint />
<field-name>runtime</field-name>
</requirement>
</requirements>
</component>
</components>
</component-set>
This isn't a fatal issue, the build continues just fine. But it is
very annoying to sometimes have that WARNING put into the build logs.
Any hints for me?
-Jesse
--
There are 10 types of people in this world, those
that can read binary and those that can not.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]