maven-plugin

Retrieving Maven Artifact from Repository using Maven Java API

风流意气都作罢 提交于 2019-12-01 04:46:13
If I have a Maven Artifact information (GroupId, ArtifactId, Version) how can I programmatically (using Java) retrieve that Artifact from my local repository? Specifically, I need to be able to connect to the Maven Repository and create/retrieve a org.apache.maven.artifact.Artifact so I can retrieve the file associated with the Artifact. I have looked into m2e source code, but the MavenImpl.java (which provides Artifact resolution) is way more complex than what I need and it is difficult to understand how the connection to the repository works. Philippe Marschall You'll probably want to look

How to bind a plugin goal to another plugin goal

≯℡__Kan透↙ 提交于 2019-12-01 04:03:34
In my current project we use some plugins needed by other plugins parameters like properties-maven-plugin or buildnumber-plugin. <?xml version="1.0"?> <project> <modelVersion>4.0.0</modelVersion> <groupId>mygroup</groupId> <artifactId>myartifact</artifactId> <packaging>pom</packaging> <version>v0</version> <name>myProject</name> <properties> <env>dev</env> </properties> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>properties-maven-plugin</artifactId> <version>1.0-alpha-2</version> <configuration> <files> <file>${basedir}/configurations/${env}.properties</file> <

exec-maven-plugin says cannot run specified program, even though it is on the PATH

余生长醉 提交于 2019-12-01 03:10:36
Edit 20140716 : Solution found tl;dr = exec-maven-plugin does not recognise .cmd files, but only .bat files, as executable scripts. Rename grunt.cmd --> grunt.bat , bower.cmd --> bower.bat , etc. as a workaround. Having done npm install -g grunt-cli on my system, grunt is most certainly on the PATH When I run maven install however, this doesn't seem to register. [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (build-spa-bower) on project foobar: Command execution failed. Cannot run program "grunt" (in directory "C:\workspace\foobar\src\main\spa"): CreateProcess

Maven include another pom for plugin configuration

陌路散爱 提交于 2019-12-01 02:09:17
问题 is there a way to include another pom or information in a maven pom ? I have several poms which are basically not related or have different parent poms. Nevertheless for packaging it is required to have a Manifest identical to all projects. So currently I have in a pom: <plugin> <artifactId>maven-assembly-plugin> <!--- .... --> <archive> <manifestEntries> <build-date>....</build-date> <build-nr>.....</build-nr> etc etc I would like to avoid to paste this configuration to all severall poms. So

properties-maven-plugin: Error loading properties-file

血红的双手。 提交于 2019-12-01 00:11:16
问题 I want to extract all the properties from my pom.xml into a properties-file. These are the common properties like dependency-versions, plugin-versions and directories. I'm using the properties-maven-plugin, but its not working as i want it to. The essential part of my pom.xml: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>properties-maven-plugin</artifactId> <version>1.0-alpha-1</version> <executions> <execution> <phase>initialize</phase> <goals> <goal>read-project-properties<

XJC Maven Plugin(jaxb2-maven-plugin) Java 11 Migration Issues

ε祈祈猫儿з 提交于 2019-11-30 20:02:54
问题 I am currently working on java 11 migration project where jaxb2-maven-plugin has been used to for XJC task. As XJC executable is not present in the JDK 11 version, I am getting below mentioned errors. [ERROR] Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:2.2:xjc (xjc-schema1) on project paymaster-service: Execution xjc-schema1 of goal org.codehaus.mojo:jaxb2-maven-plugin:2.2 :xjc failed: A required class was missing while executing org.codehaus.mojo:jaxb2-maven-plugin:2.2:xjc:

SoapUI Maven plugin- executing multiple projects

帅比萌擦擦* 提交于 2019-11-30 19:42:03
I am working on converting an Ant execution of the SoapUI TestRunner to use the maven plugin and I cannot get a good answer on how to execute multiple projects using this plugin. I found a forum post from 2010 on the Smartbear forum and there are a few approaches listed but none seem very workable (writing some script to invoke maven with different parameters or adding an execution for every project). Are there any best practices for working around this? Or has anyone seen an inventive solution to this problem? I would guess that this is a large scale problem... Here is the post I am refering

Configuring Logging for an Embedded Tomcat from Maven plugin

情到浓时终转凉″ 提交于 2019-11-30 14:40:11
问题 I'm using the Tomcat7 Maven plugin: <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.0-beta-1</version> <configuration> <update>true</update> <contextFile>${basedir}/conf/context.xml</contextFile> <tomcatUsers>${basedir}/conf/tomcat-users.xml</tomcatUsers> </configuration> </plugin> I run my app as follows (which runs tomcat embedded) mvn tomcat7:run THE ISSUE: There is no catalina.out log file? I want to turn on logging for the

Gradle - plugin maven-publish: How to publish only specific publication to a repository

妖精的绣舞 提交于 2019-11-30 14:38:45
问题 We have two different artifacts that is going to be published to two different maven repositories. " ProjectXMergedWar " should be published to " MyMavenRepo1 " (snapshots) " ProjectXJarRelease " should be published to " MyMavenRepo2 " (release) "ProjectXMergedWar" should never be published to "MyMavenRepo2" (release) "ProjectXJarRelease" should never be published to "MyMavenRepo1" (snapshots) We use the plugin maven-publish where you configure a set of publications and reposistories. The

How to get an Artifact download URL via Maven API?

醉酒当歌 提交于 2019-11-30 14:37:51
I'm trying to create a maven plugin to generate a file with the URL to all the dependencies in a project. I have been able to get the dependencies and their artifact, but I'm having trouble getting the download URL. Using ArtifactResolver and ArtifactMetadataSource I get some of the artifact information. However I fail to get all the information for all the dependencies. I haven't been able to find documentation on the resolution logic, so that I can call it form my plugin. I can use an ArtifactResolver to download the artifact, but what I really wanted was just the URL. The Maven Artifact API