Groovy 在哪里可以获得gmaven插件中预定义变量的完整列表?
在哪里可以获得在Maven中执行的Groovy脚本中可用的变量的完整列表?除此之外,也许有人知道在哪里可以找到Gmaven文档Groovy 在哪里可以获得gmaven插件中预定义变量的完整列表?,groovy,maven,gmaven-plugin,Groovy,Maven,Gmaven Plugin,在哪里可以获得在Maven中执行的Groovy脚本中可用的变量的完整列表?除此之外,也许有人知道在哪里可以找到Gmaven文档 我了解项目和设置。我假设还有其他一些..pom中的这个片段应该可以让您更好地了解运行脚本时可用的内容。大多数有趣的部分可能在binding.project中,它是MavenProject的一个实例 <build> <plugins> <plugin> <groupId>
我了解
项目
和设置
。我假设还有其他一些..pom中的这个片段应该可以让您更好地了解运行脚本时可用的内容。大多数有趣的部分可能在binding.project中,它是MavenProject的一个实例
<build>
<plugins>
<plugin>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<properties>
<hello>world</hello>
</properties>
<source>
println this.binding.variables
println project.properties
println settings.properties
</source>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
org.codehaus.groovy.maven
gmaven插件
产生资源
执行
世界
println this.binding.variables
println project.properties
println settings.properties
页面列出:
这是我已经知道的(见问题)。例如,你知道如何获得当前插件的依赖项列表吗?检查脚本中的“project”对象,它是MavenProject的一个实例,
Default Variables
By default a few variables are bound into the scripts environment:
project The maven project, with auto-resolving properties
pom Alias for project
session The executing MavenSession
settings The executing Settings
log A SLF4J Logger instance
ant An AntBuilder instance for easy access to Ant tasks
fail() A helper to throw MojoExecutionException