mojo

gwt maven war plugin configuration problem

若如初见. 提交于 2019-12-05 04:42:04
问题 I am developing a gwt application in maven. In this I am using maven war plugin. Everything works fine. When I give mvn install command it builds abc.war file in target folder. But it is not copying compiled javascript files (" module1 " and " module2 " directories present in target ) to war directory. I want to get newly compiled javascript files in war directory. How to achieve this? pom.xml file <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns

How do you force a maven MOJO to be executed only once at the end of a build?

自闭症网瘾萝莉.ら 提交于 2019-12-04 18:26:11
问题 I have a MOJO I would like executed once, and once only after the test phase of the last project in the reactor to run. Using: if (!getProject().isExecutionRoot()) { return ; } at the start of the execute() method means my mojo gets executed once, however at the very beginning of the build - before all other child modules. 回答1: The best solution I have found for this is: /** * The projects in the reactor. * * @parameter expression="${reactorProjects}" * @readonly */ private List

Parallel requests in Mojolicious application

余生长醉 提交于 2019-12-04 14:18:05
I have perl application which, for example, parallel searching in google: use Mojo::UserAgent; use Mojo::IOLoop; my $ua = Mojo::UserAgent->new(); my $delay = Mojo::IOLoop->delay(sub { say 'DONE1 (should be before render)'; }); foreach my $i ( 1 .. 10 ) { $delay->begin(); $ua->get("http://www.google.ru/search?q=$i" => sub { say $i; $delay->end(); }); } $delay->wait() unless $delay->ioloop->is_running(); say 'DONE2 (should be before render)'; say 'Found! (render)'; And it's works fine: 6 1 7 10 3 9 2 5 8 4 DONE1 (should be before render) DONE2 (should be before render) Found! (render) When I use

Maven: How to check if an artifact exists?

允我心安 提交于 2019-12-04 13:43:58
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. 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 ArtifactRepository localRepository; /** * @parameter default-value="${project.remoteArtifactRepositories}" * @required *

Maven Plugin Logger Compatibility

陌路散爱 提交于 2019-12-04 12:59:39
问题 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

perl Mojo and JSON for simultaneous requests

烈酒焚心 提交于 2019-12-04 11:51:27
I'm usually no Perl coder. However I've got to complete this task. The following code works for me: #!/usr/bin/perl use LWP::UserAgent; use JSON; use strict; my $md5 = $ARGV[0]; $md5 =~ s/[^A-Fa-f0-9 ]*//g; die "invalid MD5" unless ( length($md5) == 32 ); my $ua = LWP::UserAgent->new(ssl_opts => { verify_hostname => 1 }, timeout => 10); my $key="12345...7890"; my $url='https://www.virustotal.com/vtapi/v2/file/report'; my $response = $ua->post( $url, ['apikey' => $key, 'resource' => $md5] ); die "$url error: ", $response->status_line unless $response->is_success; my $results=$response->content;

Maven Password Encryption for Other Properties

亡梦爱人 提交于 2019-12-04 11:26:15
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's password encryption for anything other than server password nodes? Would love to make this work for

How to define a default mojo for a maven plugin

旧街凉风 提交于 2019-12-03 18:03:26
问题 I've written a plugin that generate one file in target/generated-sources/. This plugin only has one mojo. This mojo is declared with the following : /** * @goal convertsql * @phase generate-sources * @requiresProject */ public class ConverterMojo extends AbstractMojo { In the project, i want to use the plugin but it doesn't work if i don't specify the executions tag : <executions> <execution> <id>convert</id> <goals><goal>convertsql</goal></goals> <phase>generate-sources</phase> </execution>

How do you force a maven MOJO to be executed only once at the end of a build?

一笑奈何 提交于 2019-12-03 12:59:54
I have a MOJO I would like executed once, and once only after the test phase of the last project in the reactor to run. Using: if (!getProject().isExecutionRoot()) { return ; } at the start of the execute() method means my mojo gets executed once, however at the very beginning of the build - before all other child modules. The best solution I have found for this is: /** * The projects in the reactor. * * @parameter expression="${reactorProjects}" * @readonly */ private List reactorProjects; public void execute() throws MojoExecutionException { // only execute this mojo once, on the very last

Java Maven MOJO - getting information from project POM

心已入冬 提交于 2019-12-03 10:45:49
问题 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