maven-antrun-plugin

Run ant task in maven build phase before war is packaged?

梦想的初衷 提交于 2019-12-06 09:23:26
When deploying a webapp I need to concat some files, currently this is achieved via an ant task. I'm trying to run this task in the maven build process using something like the following: <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.7</version> <executions> <execution> <phase>package</phase> <configuration> <target> <move file="${project.build.directory}/${project.name}-${project.version}/WEB-INF/classes/log4j.dev.properties" tofile="${project.build.directory}/${project.name}-${project.version}/WEB-INF/classes/log4j.properties" /> <move file="${project.build.directory}/$

How to do input task in maven antrun plugin

a 夏天 提交于 2019-12-05 21:50:14
I created a maven project and i'm trying to run an external script. In this external script, i use read command to ask a question and get an answer. It works if i do a sudo mvn package with exec-maven-plugin But, but, but : If i do a sudo mvn package , my script doesn't stop at read command. If i do a sudo mvn release:prepare with exec-maven-plugin, my script doesn't stop at read command. If i do a sudo mvn release:prepare with maven-antrun-plugin, my script doesn't stop at read command. And obviously, i need to do a release :) I tried to to change the first line of my script (#/usr/bin/bash,

Maven and Ant Can't run Java - CreateProcess error=206, The filename or extension is too long

耗尽温柔 提交于 2019-12-05 10:02:52
When maven via antrun executes this java code I get the dreaded error=206, The filename or extension is too long <java classname="com.me.api" failonerror="true" fork="true" maxmemory="128m" output="${wsdlFile}.out"> <arg value="${className}" /> <arg value="${name}" /> <arg value="${wsdlFile}" /> <classpath> <path refid="maven.test.classpath" /> </classpath> Maven creates lengthy classpaths due to the structure and location of the local maven repo. We need to use a pathing jar. Convert Classpath into string Escape windows drive letter (C: = bad \C: = good) Create manifest only jar with class

Parent properties inside maven antrun plugin

谁都会走 提交于 2019-12-05 07:38:11
There is a multi-module project. Inside the child I need to do some complicated stuff (integration test with deploying to application server and so on). So there is an integrationtest child, and from this module I need the root of the parent to reach other modules. I do not want to use "..". There is a property in integrationtest POM: <properties> <main.basedir>${project.parent.basedir}</main.basedir> ... </properties> And there is an antrun plugin with the following content: <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>render-parameter-sql</id>

Maven:install jar file during build process

女生的网名这么多〃 提交于 2019-12-05 01:37:26
I have got a requirement as follows. I need to run ant build file during maven build process. I need to invoke the build.xml from my pom.xml file. I have done that using maven-antrun-plugin. Now I need to install the ant build generated jar file automatically into my local repository before maven compiles my project source. I tried using build-helper-maven-plugin but it did not help. Either I am doing something wrong, or i am not doing right. Please help. Update Thank you. ant maven tasks worked for me as well. However I am runing into the following exception at the end of the build process.

How to echo in Maven without Antrun plugin?

假如想象 提交于 2019-12-04 17:48:11
问题 How can I print to the console while executing a mvn command (in a phase/goal), but not using Maven Antrun plugin? Why I reject Antrun solutions: The overhead in code to print a single message is massiv. The output is no formated like maven output I cannot attach a severity to the message (e.g. DEBUG, INFO, ERROR, etc) Currently an Ant-echo looks like this (see line with "hello world"): [INFO] --- maven-antrun-plugin:1.7:run (default) @ ejpd-alertmanager-ear --- [WARNING] Parameter tasks is

Maven Antrun Not Executing Tasks

空扰寡人 提交于 2019-12-04 11:20:56
问题 I'm using Maven AntRun plugin 1.6 and from their example I cannot code the following ant task to be executed. Example url: http://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.html I just get the following message when I execute mvn antrun:run. No ant target defined - SKIPPED What am I doing wrong? Here's my POM: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.6</version> <executions> <execution> <id>compile</id>

Calling foreach in maven-antrun-plugin

我与影子孤独终老i 提交于 2019-12-04 07:30:15
I'm trying to set up maven to execute the LESS CSS preprocessor on a directory in my web project. The basic flow is: Maven calls maven-antrun-plugin. Ant-contrib <foreach/> loops through a directory and finds all the .less files and calls a target. The target executes Rhino, which executes LESS which converts the file. To do this, I have the following XML: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.7</version> <executions> <execution> <phase>compile</phase> <configuration> <target name="processLessFile"> <!-- ... --> </target>

Is it possible to set a maven property from ant?

浪子不回头ぞ 提交于 2019-12-04 03:38:14
I tried to use the maven-antrun-plugin to check in a first execution if a file exists and then set a property accordingly. In another execution (another phase) of the antrun-plugin I want to make use of the property. But the property set in one execution cannot be used in another execution since it's an ant and not a maven property and doesn't get propagated. Is it possible to propagate the ant property to maven or in other words set a maven property from ant? Using another Maven build like in this question is not an option. Another way that might work somehow would be an external build.xml

Maven antrun: pass maven properties to ant

久未见 提交于 2019-12-04 00:07:31
问题 I am trying to pass maven properties (defined through profiles) to a antrun execution: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.7</version> <dependencies> <!-- ... these are ok --> </dependencies> <executions> <execution> <configuration> <target> <property name="ant_destDir" value="${destDir}" /> <property name="ant_serverDeploy" value="${serverDeploy}" /> <property name="ant_deployDir" value="${deployDir}" /> <property name=