Maven antrun plugin调用Ant Optional Task

来源:互联网 发布:纳奇网络推广平台 编辑:程序博客网 时间:2024/05/19 04:04

 

 

<tasks>
        <echo message="zws" />
        <taskdef name="propertyfile"
         classname="org.apache.tools.ant.taskdefs.optional.PropertyFile"
         classpathref="maven.compile.classpath"  />
        <propertyfile file="version.properties">
         <entry key="version" value="7.1.5" />
        </propertyfile>
  </tasks>

如果不声明task,总是会报class not found

 

目前想到的方法就是显式的声明一下task。classpathref引用到"maven.compile.classpath" 或"maven.runtime.classpath"

 

顺便提一下,Maven的classopath有:compile,provided,runtime,test,system.

原创粉丝点击