Questions tagged [maven-antrun-plugin]

This plugin provides the ability to run Ant tasks from within Maven. You can even embed your Ant scripts in the POM!

Introduction

This plugin provides the ability to run Ant tasks from within Maven. You can even embed your Ant scripts in the POM!

It is not the intention of this plugin to provide a means of polluting the POM, so it's encouraged to move all your Ant tasks to a build.xml file and just call it from the POM using Ant's task.

One of the main purposes of this plugin is to facilitate the migration from Ant based projects to Maven. Some projects may not currently be able to migrate because they depend on custom build functionality that Maven doesn't provide by default.

Official site : http://maven.apache.org/plugins/maven-antrun-plugin/

Goals Overview

antrun:run runs Ant tasks for Maven.

215 questions
9
votes
3 answers

Run a Ant task in Maven only if a property is set

My pom.xml is running an Ant task to deploy a file using FTP. However, this deployment must be only done if the -Dftp=true argument is given in the Maven command (i.e. mvn clean install -Dftp=true). Thus, I wrote the following code:
Romain Linsolas
  • 79,475
  • 49
  • 202
  • 273
9
votes
4 answers

How to execute tasks conditionally using the maven-antrun-plugin?

I need to execute some ant commands depending on an environment variable passed in as a parameter to the maven build command. At the moment I have 3 tasks blocks and only the tasks block with no condition is being executed.
vaughan
  • 6,982
  • 6
  • 47
  • 63
9
votes
1 answer

Plugin maven-antrun-plugin execution not covered by lifecycle configuration with m2e

I know this has been asked before but I'm still struggling on solving this issue. When I load projects into eclipse I get the following exception: Plugin execution not covered by lifecycle configuration:…
Avi
  • 21,182
  • 26
  • 82
  • 121
9
votes
6 answers

Maven Antrun and Dependencies

(See edits below.) The reason I can't just use the classpath, is because I need to manage some non-java libraries, and I'm compiling a non-java project. I'm trying to use maven dependencies in an antrun call, following the documentation on the maven…
Aaron H.
  • 6,407
  • 5
  • 25
  • 30
8
votes
2 answers

Ant running from maven-antrun-plugin can't find scripting engine on Java 9

I have a Maven project using an Ant build file: 4.0.0 my-test-app my-test-group 1.0-SNAPSHOT
Dan Berindei
  • 7,054
  • 3
  • 41
  • 48
8
votes
2 answers

How do I prevent Maven build fail on Ant task failure?

I'm using the FTP Ant task with maven-antrun-plugin org.apache.maven.plugins maven-antrun-plugin ftp
mickthompson
  • 5,442
  • 11
  • 47
  • 59
7
votes
2 answers

Set directory in Maven Antrun Plugin

I've downloaded jquery-ui to my webapp which has a build.xml for compressing and minifying. Now I would like to run this build.xml from within my pom.xml: org.apache.maven.plugins
dtrunk
  • 4,685
  • 17
  • 65
  • 109
7
votes
4 answers

Maven antrun with sequential ant-contrib fails to run

We have a special routine to explode files in a subfolder into extensions, which will be copied and jared into single extension files. For this special approach I wanted to use the maven-antrun-plugin, for the sequential iteration and jar packaging…
Christopher Klewes
  • 11,181
  • 18
  • 74
  • 102
7
votes
1 answer

Parent properties inside maven antrun plugin

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…
Gábor Lipták
  • 9,646
  • 2
  • 59
  • 113
7
votes
4 answers

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

When maven via antrun executes this java code I get the dreaded error=206, The filename or extension is too long
Peter Kahn
  • 12,364
  • 20
  • 77
  • 135
6
votes
1 answer

How do I redirect maven's antrun exec command's output to stdout?

I'm using Maven 3.0.3. I have this antrun task, which uses the "exec" command ... maven-antrun-plugin
Dave
  • 15,639
  • 133
  • 442
  • 830
6
votes
2 answers

Maven: Only execute plugin when a command line flag is present

I want Maven to only run a certain plugin when there is a flag on the command line when I call the mvn command. for example: Let's say I have a plugin called maven-foo-plugin. I only want maven to run this plugin when the flag --foo is present when…
5
votes
2 answers

Replace task in Maven Antrun Plugin

I am using antrun plugin in my maven build to replace a token @version@ in some of the JSP files with the application version. This is what I am doing: maven-antrun-plugin 1.6
Arpit
  • 6,212
  • 8
  • 38
  • 69
5
votes
2 answers

Calling foreach in maven-antrun-plugin

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 loops through a directory and finds all the .less files and calls a…
Brian Nickel
  • 26,890
  • 5
  • 80
  • 110
4
votes
2 answers

Maven antrun move not deleting source file

Developing on Windows 10 I have a Java project in Maven that has a Linux "launcher" shell script for the FooBar utility stored in the repository at src/bin/foobar.sh. It uses resource filtering to substitute in the correct executable JAR path so…
Garret Wilson
  • 18,219
  • 30
  • 144
  • 272
1
2
3
14 15