A property is set in the Ant build for each project dependency. Each property name uses the format groupId:artifactId:type[:classifier]. For example, to show the path to a jar dependency with groupId "org.apache" and artifactId "common-util", the following could be used.
<echo message="${org.apache:common-util:jar}"/>
If the dependency includes a classifier, the classifier is appended to the property name. For example, groupId "org.apache", artifactId "common-util", type "jar", and classifier "jdk14".
<echo message="${org.apache:common-util:jar:jdk14}"/>
Note: the old format "maven.dependency.groupId.artifactId[.classifier].type.path" has been deprecated and should no longer be used.
You can also use these classpath references:
- maven.compile.classpath
- maven.runtime.classpath
- maven.test.classpath
- maven.plugin.classpath
For example, to display Maven's classpaths using antrun, we can do this
<project> <modelVersion>4.0.0</modelVersion> <artifactId>my-test-app</artifactId> <groupId>my-test-group</groupId> <version>1.0-SNAPSHOT</version> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.8</version> <executions> <execution> <id>compile</id> <phase>compile</phase> <configuration> <target> <property name="compile_classpath" refid="maven.compile.classpath"/> <property name="runtime_classpath" refid="maven.runtime.classpath"/> <property name="test_classpath" refid="maven.test.classpath"/> <property name="plugin_classpath" refid="maven.plugin.classpath"/> <echo message="compile classpath: ${compile_classpath}"/> <echo message="runtime classpath: ${runtime_classpath}"/> <echo message="test classpath: ${test_classpath}"/> <echo message="plugin classpath: ${plugin_classpath}"/> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
or alternatively, we can use an external build.xml.
<project> <modelVersion>4.0.0</modelVersion> <artifactId>my-test-app</artifactId> <groupId>my-test-group</groupId> <version>1.0-SNAPSHOT</version> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.8</version> <executions> <execution> <id>compile</id> <phase>compile</phase> <configuration> <target> <property name="compile_classpath" refid="maven.compile.classpath"/> <property name="runtime_classpath" refid="maven.runtime.classpath"/> <property name="test_classpath" refid="maven.test.classpath"/> <property name="plugin_classpath" refid="maven.plugin.classpath"/> <ant antfile="${basedir}/build.xml"> <target name="test"/> </ant> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
The build.xml:
<?xml version="1.0"?> <project name="test6"> <target name="test"> <echo message="compile classpath: ${compile_classpath}"/> <echo message="runtime classpath: ${runtime_classpath}"/> <echo message="test classpath: ${test_classpath}"/> <echo message="plugin classpath: ${plugin_classpath}"/> </target> </project>
相关推荐
Maven权威指南 Authors Tim O'Brien (Sonatype, Inc.) , John Casey (Sonatype, Inc.) , Brian Fox (Sonatype, Inc.) , Bruce Snyder () , Jason Van Zyl (Sonatype, Inc.) , Juven Xu () Abstract Maven权威指南...
Referencing using the Harvard author-date 是科技工作者发表论文必须要掌握的要点,大名鼎鼎不多说了。
This is a guide to the Harvard author-date referencing system. It is based on the following manual: Commonwealth of Australia 2002, Style manual for authors, editors and printers, 6th edn, rev. by ...
Submit a pull request, referencing the relevant Jira case Attach a Git patch file to the relevant Jira case Use of the Pentaho checkstyle format (via mvn checkstyle:check and reviewing the report) ...
另外一个简单介绍线性参考基本知识的PPT 理论与例子相结合~~ 对大家学习很有帮助~~
一个介绍线性参考基本知识的PPT 理论与例子相结合~~ 对大家学习很有帮助~~
NULL 博文链接:https://caohong286.iteye.com/blog/1482168
Write a program called String1.java and do the following: Create a String object that accepts ... Referencing the JDK docs, execute 2 different methods on the String. Print the results of the methods
Similarly, the CUST_ID and TIME_ID columns are also foreign keys in the SALES table referencing the CUSTOMERS and TIMES tables, respectively. Evaluate the following CREATE TABLE command: CREATE TABLE...
Creating a RESTful Root Resource Class 220 Example Applications for JAX-RS 235 Further Information about JAX-RS 240 Part IV: Enterprise Beans 243 Chapter 14: Enterprise Beans 245 What Is an ...
Linear Referencing and Dynamic Segmentation in ArcGIS, 动态分段方面的资料,外文的.
The library provides an activity that your app can spawn that allows the user to open and save files. Including In Your Project This library is distributed as Android library project so it can be ...
this is targetlink exercise files for model_referencing
Harvard Referencing这个版本相当的权威,有助于大家参考如何写reference
文献查询及索引information searching and referencing
mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any ...
Become aware of the seamlessness and power of Spring by referencing the easy-to- understand sample application we provide. Learn how to replace common EJB features with Spring alternatives, including...
referencing the appropriate section of this document. 1.3 Requirement Wording Conventions Within this document, the following conventions are applied: The word "shall" is to be used in the following...
- NEW: Added UICamera.first referencing the active NGUI event system. - FIX: Alpha should now work as expected with Linear lighting. - FIX: UICamera.isOverUI should now work properly for all types of ...
Once the users click the button “Check and Repair” on the main form, the programme will finish verification, checking, downloading, repairing and registering automatically, without any further ...