maven-plugin

Making HTTP requests during maven archetype:generate

江枫思渺然 提交于 2019-12-03 20:26:16
I'm building an archetype for creating standardised projects within the company. The actual project files generated are fine, I'd now like to integrate the archetype with the process of setting up infrastructure, such as Stash repositories and Jenkins jobs. For example, simplistically I'd like the maven archetype:generate process to include an HTTP REST POST to http://stash.example.com/rest/api/1.0/projects/LABS/repos/{artifactId} in order to create a GIT repo. Likewise something similar for Jenkins build jobs. I would be nice if, prior to creating the maven project, some tests could be done

jar file gets corrupted while building with maven

℡╲_俬逩灬. 提交于 2019-12-03 19:22:52
问题 while building a war file i am copying a set of jars from a location to a folder inside the war. While the files do get copied , however i think they get corrupted because the same class files of the jar when taken outside the war opens with a debugger while it does not open after taking from war file . This is a part of my war pom.xml where i copy the jars <execution> <id>copy-jars</id> <phase>process-resources</phase> <goals> <goal>copy-resources</goal> </goals> <configuration>

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>

Creating Hermetic Maven Builds

…衆ロ難τιáo~ 提交于 2019-12-03 17:47:31
问题 I am attempting to create a way in which hermetic builds can be achieved while still relying on SNAPSHOT dependencies in your project. For the purposes of example, say I have a project which has a dependency structure like this: ┌ other-1.2-SNAPSHOT mine-1.2.3 ──┤ └ thing-3.1-SNAPSHOT ── gizmo-6.1.3-SNAPSHOT What I would like to do is resolve all the SNAPSHOT dependencies locally to something which is related to my current version and then deploy those as releases to my Nexus' release

How to deploy war on remote Tomcat

牧云@^-^@ 提交于 2019-12-03 16:45:41
I would like to deploy a WAR on remotely located Tomcat using maven-tomcat plugin. But having problems with it and getting exception (mentioned below). Please guide. Command Used: mvn tomcat:redeploy Error Log: [ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project PageNameService: Cannot invoke Tomcat manager: Connection refused: connect - [Help 1] settings.xml <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.4.3:test (default-test) on project smrr: There are test failures

点点圈 提交于 2019-12-03 16:15:06
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.4.3:test (default-test) on project smrr: There are test failures. Please refer to C:\Users\root\Downloads\smrr\target\surefire-reports for the individual test results. -> [Help 1] To see the full stack trace of the errors, re-run Maven with the -e switch. Re-run Maven using the -X switch to enable full debug logging. For more information about the errors and possible solutions, please read the following articles: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException Check Maven network proxy... ===

Get dependencies of WAR Artifact using Maven 2 API

我的梦境 提交于 2019-12-03 16:12:44
I have found a few posts surrounding the question of artifact retrieval however the answers don't seem to work in my specific case. I am writing a plugin that will help with skinny war EAR generation and I am running a plugin that I have written for my EAR maven module. In the plugin code I have got to the stage where I want to be able to get the dependencies / artifacts of the WAR dependencies - currently these are not coming through with anything I have tried. I presume this is because even running a dependency:tree on my EAR module doesn't include them, they are not 'transitive'

How to attach a maven plugin to a phase by default?

别等时光非礼了梦想. 提交于 2019-12-03 16:11:03
问题 I have a maven plugin that should run in the compile phase, so in the project that consumes my plugin, I have to do something like this: <executions> <execution> <phase>compile</phase> <goals> <goal>my-goal</goal> </goals> </execution> </executions> What I need is to by default attach my-goal to the compile phase if the user has included my plugin already (ideally the above part wouldn't be necessary, just the plugin declaration). Is this possible? 回答1: Put an @phase annotation in your Mojo

Maven plugin version not specified

只愿长相守 提交于 2019-12-03 15:16:31
问题 I have just noticed that plugin's version is optional in maven. I can still build my module without specifying it. Let's take an example with maven-bundle-plugin. <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> .... </plugin> I have written a simple pom.xml without a parent to try this out, so pluginManagement is not involved. I have also checked the super super pom-4.0.0.xml in maven-model-builder to confirm that maven

Bad request when updating Appengine with mvn appengine:update

こ雲淡風輕ζ 提交于 2019-12-03 13:07:55
问题 i'm getting the following error, when I try to update a appengine-application with the appengine-maven-plugin: 400 Bad Request Error when loading application configuration: Unable to assign value '1.8.3' to attribute 'version': Value '1.8.3' for version does not match expression '^(?:^(?!-)[a-z\d\-]{0,62}[a-z\d]$)$' This is confusing to my because my appengine-web.xml looks like follows: <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>helloworld</application>