mojo

How to get the current MavenSession or MavenExecutionRequest from a Plexus Component

拈花ヽ惹草 提交于 2019-12-03 09:17:18
I created a Plexus component to house common logic for several Mojos I want to create. I have been able to pass information like localRepository and project from the Mojo (and test cases). I was wondering if there is a way to get the MavenSession or MavenExecutionRequest from within the component without having to pass them as parameters from a Mojo. I know my component will be running from a Maven Mojo. I'm using Maven 2 in this instance. I don't believe there is, nor would I think it's a good idea. From my understanding, what you're aiming to achieve is have a commons-like component, that

Maven Plugin Logger Compatibility

假装没事ソ 提交于 2019-12-03 08:18:56
I am writing a Maven plugin (Mojo) that imports a Jar library used by other projects. At least one of the classes in that library use Apache Log4j for logging, but Log4j is not going to be properly configured by the logger that Maven provides to the Mojo. Is there any simple way to bridge between these? Unfortunately, org.apache.log4j.Logger and org.apache.maven.logging.Log do not share a common superinterface or superclass, so I can't simply have a setLog() type function. Any suggestions would be welcome; currently I am planning to either just ignore it, or write a bridge class that can use

Java Maven MOJO - getting information from project POM

会有一股神秘感。 提交于 2019-12-03 01:14:46
I am working on a maven plugin. I seem to have a hard time figuring out, what would be a good way to get POM information from project in which you execute the MOJO ? For instance if I execute my mojo in another maven project I would like to get project name or some other parameters. And one more thing, there is a context MAP in AbstractMojo.java class there is private Map pluginContext, could someone correct me if I am wrong but this is suppose to be used for passing information between mojos ? You can inject the current maven project into your mojo with a field declared like this: /** *

Any way to specify a FileSet as command line parameter?

无人久伴 提交于 2019-11-30 15:31:13
问题 I'm creating a Mojo which doesn't need a project to run. I would like to use something similar to org.apache.maven.model.FileSet (providing multiple directories with includes and excludes) as a @parameter but my problem is that I need to be able to set those values using command line. Any idea how to achieve this? 回答1: See: Guide to Developing Java Plugins, Parameter Types With Multiple Values Using Plugin Tools Java5 Annotations Maven Plugin Tool for Annotations, Supported Annotations org

Any way to specify a FileSet as command line parameter?

末鹿安然 提交于 2019-11-30 14:19:02
I'm creating a Mojo which doesn't need a project to run. I would like to use something similar to org.apache.maven.model.FileSet (providing multiple directories with includes and excludes) as a @parameter but my problem is that I need to be able to set those values using command line. Any idea how to achieve this? See: Guide to Developing Java Plugins, Parameter Types With Multiple Values Using Plugin Tools Java5 Annotations Maven Plugin Tool for Annotations, Supported Annotations org.apache.maven.model.FileSet POM <groupId>so</groupId> <artifactId>multiple-values-maven-plugin</artifactId>

A required class was missing while executing org.apache.maven.plugins:maven-war-plugin:2.1.1:war

余生长醉 提交于 2019-11-30 11:33:42
Here is my clean install -x result: [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building test Maven Webapp 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test --- [INFO] Deleting C:\Users\utopcu\workspace\test\target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test --- [WARNING] Using platform encoding (Cp1254 actually) to copy filtered resources, i.e. build is platform

A required class was missing while executing org.apache.maven.plugins:maven-war-plugin:2.1.1:war

大兔子大兔子 提交于 2019-11-29 16:44:54
问题 Here is my clean install -x result: [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building test Maven Webapp 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test --- [INFO] Deleting C:\Users\utopcu\workspace\test\target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test ---