mojo

Maven: How to check if an artifact exists?

此生再无相见时 提交于 2020-02-20 11:42:26
问题 How do I check from within a Mojo if an artifact already exists in the local repository? I'm installing large binaries into the local Maven repository and I need to know if they already exist before attempting to download them. 回答1: Solved with the help of http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook /** * The local maven repository. * * @parameter expression="${localRepository}" * @required * @readonly */ @SuppressWarnings("UWF_UNWRITTEN_FIELD") private

Unit Testing Maven Mojo - Components and parameters are null

让人想犯罪 __ 提交于 2020-02-03 08:49:55
问题 Based on the documentation and mailing threads I have seen 3 ways to inject the maven project into my mojo: /** * Project instance * * @parameter default-value="${project}" * @required * @readonly */ private MavenProject project; @Component private MavenProject project; @Parameter( expression = "${project}" ) private MavenProject project; But regardless of which one of these I choose, when I run the unit test based on the example I found in maven docs, project is always null. public void

Maven Mojo: Taking complete control over logging / Forbid other plugins to log

旧巷老猫 提交于 2020-01-15 10:53:32
问题 I don't know if this is actually possible, but can I take complete control over logging from inside a Maven Mojo? With complete control I mean that only messages from my Mojo are logged or that I can decide wether a given message shall be logged. The context is that I'm using the maven-scm-plugin in my plugin to do some SCM action and it floods the log with [INFO] Executing: cmd.exe /X /C "svn --non-interactive update D:\..." [INFO] Working directory: D:\... while my own messages get lost and

Maven: Get goal configuration from execution element

断了今生、忘了曾经 提交于 2020-01-15 01:48:26
问题 Let's imagine I have following mojo: @Mojo(name = "some-goal") public class MyMojo { @Parameter(required = true) protected ComplexObject param; /*...*/ } Also I have plugin's descriptor in pom: <plugin> <!-- here artifact description --> <executions> <execution> <phase>...</phase> <goals><goal>some-goal</goal></goals> <configuration> <param>...</param> </configuration> </execution> </executions> </plugin> For test this plugin I use maven-plugin-testing-harness And my test code is: @Test

Mojolicious, Layouts and Positioning of Javascript

拟墨画扇 提交于 2020-01-13 19:52:13
问题 I want to load most of my scripts in my main layout ( i.e jquery). Now from my understanding it is best practice to position scripts at the bottom of my html page. However if we put the script at the bottom of the layout page like so. layout/default.html.ep <!doctype html> <html> <head><title><%= title %></title></head> <body><%=content %></body> </html> <script src="js/jquery.min.js" type="text/javascript"></script> And then use this layout in a page that has its own javascript that relies

hadoop windows org.codehaus.mojo:exec-maven-plugin

[亡魂溺海] 提交于 2020-01-06 04:01:07
问题 I am trying to install hadoop on my windows machine. I am following this guide: https://wiki.apache.org/hadoop/Hadoop2OnWindows but when I have to execute this line: mvn package -Pdist,native-win -DskipTests -Dtar I have this error: [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (com pile-ms-winutils) on project hadoop-common: Command execution failed. Process ex ited with an error: 1(Exit value: 1) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the

How can I extract iframes from text with Perl's Mojo::DOM

泄露秘密 提交于 2020-01-04 06:33:30
问题 I have this text and when I do: print STDERR (Mojo::DOM->new($args->{'body'})->at('iframe')); output: <iframe allowfullscreen="" frameborder="0" height="360" scrolling="no" src="http://localhost:8000/embed/static/clips/2012/12/17/28210/test-rush" width="480"> </iframe>` It is just printing the first iframe in the body. Why is it not printing the other iframes and can I put all iframes in an array? 回答1: According to Mojo::Dom documentation. The at function only finds the first element matching

Maven Password Encryption for Other Properties

走远了吗. 提交于 2020-01-01 12:08:27
问题 I would like to use Maven's password encryption such as it uses for nodes for properties of a Mojo. I tried just pasting an encrypted password into the correct property for the mojo, but it treated it as plain text. I was hoping there was an attribute I could set on the annotation for the Mojo property that would explain that it could be encrypted, and if so, to use the system master password to decrypt, but I don't see anything in the documentation for that. Has anybody managed to use Maven

Maven plugin MOJO API in term of parameters

℡╲_俬逩灬. 提交于 2019-12-24 16:42:26
问题 From my understanding the MOJO relative to the compile goal of the maven-compiler-plugin defines its own parameters,just like any other MOJO plugins. For example it should have a parameter defined somewhat like the following: /** @parameter default-value="${project.build.sourceDirectory}" */ private String sDir; So these parameters definitions represent a kind of API for the MOJO, that we can set in various way, mainly from the execution tag. Please,correct me if I'm wrong. My question is:

How to configure Selenium HTML Reports in Jenkins

为君一笑 提交于 2019-12-21 05:13:12
问题 We have a Java MOJO configured in Jenkins. Once the code is build in CI, surefire reports would be generated. We have Junit and Selenium test cases to test the application. I need to present the results coming from the test cases in a HTML format. Is there any plugin available for Jenkins to display the content in HTML format? 回答1: First you need to install the Selenium HTML Report Plugin. If you are not aware of installing the plugin, use this link After installing the Selenium HTML report