Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
maven ant echoproperties任务_Maven - Fatal编程技术网

maven ant echoproperties任务

maven ant echoproperties任务,maven,Maven,我是马文的新手。我已经使用ant编写了构建脚本。我试图在maven中显示所有evn属性、用户定义属性、系统属性等。在ant中,我可以做到以下几点 我试着用maven antrun插件对maven做同样的事情 但是得到以下错误 Embedded error: Could not create task or type of type: echoproperties. Ant could not find the task or a class this task relies upon. 无论是

我是马文的新手。我已经使用ant编写了构建脚本。我试图在maven中显示所有evn属性、用户定义属性、系统属性等。在ant中,我可以做到以下几点

我试着用maven antrun插件对maven做同样的事情

但是得到以下错误

Embedded error: Could not create task or type of type: echoproperties.
Ant could not find the task or a class this task relies upon.
无论是否使用echoproperties,如何查看maven中的所有属性。这是我在maven中的配置

         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>${maven.plugin.antrun.version}</version>
            <executions>
                <execution>
                    <phase>validate</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <tasks>
                            <echo>Displaying value of properties</echo>
                            <echo>[org.junit.version] ${org.junit.version}</echo>
                            <echoproperties prefix="org" />
                        </tasks>
                    </configuration>
                </execution>
            </executions>
        </plugin>

org.apache.maven.plugins
maven antrun插件
${maven.plugin.antrun.version}
验证
跑
显示属性的值
[org.junit.version]${org.junit.version}

对我来说,使用
maven
2.2.1和3.0.1很好。运行的片段

[INFO] --- maven-antrun-plugin:1.6:run (default) @ myproject ---
[INFO] Executing tasks

main:
[echoproperties] #Ant properties
[echoproperties] #Sun Dec 26 20:08:02 IST 2010
[echoproperties] org.aspectj\:aspectjrt\:jar=D\:\\maven\\.m2\\repository\\org\\a
spectj\\aspectjrt\\1.6.8\\aspectjrt-1.6.8.jar
[echoproperties] org.aspectj\:aspectjweaver\:jar=D\:\\maven\\.m2\\repository\\or
g\\aspectj\\aspectjweaver\\1.6.8\\aspectjweaver-1.6.8.jar
...
您使用的是哪个版本的
maven
(最新版本为3.0.1)?maven antrun插件的哪个版本(最新版本为1.6)

最新版本的
maven-antrun-plugin
标记提供了一个不推荐使用的警告<代码>
应改为使用

<configuration>
    <target>
         <echoproperties prefix="org" />
     </target>
</configuration>


谢谢,它在我安装mvn时有效,但在我进行mvn验证时无效。可能是因为默认阶段是安装,而不是验证。将阶段定义元素validate添加到执行元素