Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn Off Logging Ant Copy Task in AntRun

Tags:

ant

I'm copying some files in an Ant Task within Maven and I cannot figure out how to tell ant not to log the fact that it is copying some files.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <version>1.7</version>
    <executions>
      <execution>
        <id>generateContext</id>
        <phase>compile</phase>
        <configuration>
          <target>
            <copy file="src/main/context/context.xml"
              toDir="target/context/"
              overwrite="true" verbose="false">
              <filterset>
                <filter token="deploy.path" value="${deploy.path}" />
                <filter token="build.env.deployment.war.name"
                  value="${build.env.deployment.war.name}" />
              </filterset>
            </copy>
          </target>
        </configuration>
        <goals>
          <goal>run</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

Every time I execute the task I see the following in the console:

[INFO] --- maven-antrun-plugin:1.7:run (generateContext) @ jive-web ---
[INFO] Executing tasks

 main:
     [copy] Copying 1 file to /Users/jmajors/turbinetrunk/jive/jive-web/target/context

Based upon the ant copy task documentation I wouldn't have thought that I would even need to worry about it, because it appears that logging is turned off by default, but that doesn't appear to be impacting whether or not something is logged. Is there another setting that I should be paying attention to?

Thanks, Jeremy

like image 660
jwmajors81 Avatar asked Nov 12 '22 01:11

jwmajors81


1 Answers

When running Ant standalone, you would add the -quiet command line argument.

Here within Maven, it is the Maven AntRun plugin which is controlling the verbosity of Ant. As far as I can see, the verbosity of Ant is equal to the setup of the log of the Maven AntRun plugin.

I don't know much of Maven, if you can figured out how to set the level of log of the Maven AntRun plugin to "WARN", it will become quieter.

You could use the -q command line argument of Maven, but everything in Maven will become quieter.

like image 103
Nicolas Lalevée Avatar answered Jan 04 '23 03:01

Nicolas Lalevée