我想用內行dependency:build-classpath
創建一個類路徑:如何在不抑制正常輸出的情況下抑制Mavens INFO垃圾郵件?
$ mvn dependency:build-classpath -Dmdep.prefix='lib' -f xpath.pom [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building xpath 1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-dependency-plugin:2.1:build-classpath (default-cli) @ xpath --- [INFO] Dependencies classpath: lib/serializer-2.7.1.jar:lib/xalan-2.7.1.jar:lib/xml-apis-1.3.04.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.251s [INFO] Finished at: Tue Feb 26 16:37:01 CET 2013 [INFO] Final Memory: 5M/109M [INFO] ------------------------------------------------------------------------
我怎麼能阻止內行信息垃圾郵件,同時抑制build-classpath
預期的輸出?
我找到了答案,這說明我必須使用-q
選項來禁止INFO輸出。但是使用這個選項根本沒有輸出。
我知道我可以使用grep
,但我想避免它。我無法相信Maven無法做到這一點,因爲它使得依賴插件非常無用。
這是完整的POM:
<?xml version="1.0"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>nobody</groupId> <artifactId>xpath</artifactId> <version>1</version> <dependencies> <dependency> <groupId>xalan</groupId> <artifactId>xalan</artifactId> <version>2.7.1</version> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <phase>initialize</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.basedir}/lib</outputDirectory> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>
似乎是唯一的出路。 – ceving 2013-02-27 10:46:39