2011-03-06 1 views

답변

3

페이지 http://docs.codehaus.org/display/GMAVEN/Executing+Groovy+Code 목록 :

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 
1

이 스 니펫은 스크립트를 실행하는 동안 사용할 수있는 정보를 제공합니다. 흥미로운 비트의 대부분은 MavenProject의 인스턴스 인 binding.project에 있습니다.

<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> 
+0

이것은 내가 (질문 참조) 이미 알고 있어요 것입니다. 현재 플러그인의 종속성 목록을 어떻게 얻을 수 있는지 알고 있습니까? – yegor256

+0

MavenProject의 인스턴스 인 스크립트에서 'project'개체 (http://maven.apache.org/ref/2.0.4/maven-project/apidocs/org/apache/maven/project/MavenProject)를 검사하십시오. HTML – TheKaptain