Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed package names to new package

...

Code Block
<plugin>
    <groupId>org.codehaus.groovy.maven<gmaven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    <configuration>
        <source>
            println "Hi"
        </source>
    </configuration>
</plugin>

...

Code Block
<plugin>
    <groupId>org.codehaus.groovy.maven<gmaven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    <executions>
        <execution>
            <phase>generate-resources</phase>
            <goals>
                <goal>execute</goal>
            </goals>
            <configuration>
                <source>
                    if (project.packaging != 'pom') {
                        log.info('Copying some stuff...')

                        def dir = new File(project.basedir, 'target/classes/META-INF')

                        ant.mkdir(dir: dir)
                        ant.copy(todir: dir) {
                            fileset(dir: project.basedir) {
                                include(name: 'LICENSE.txt')
                                include(name: 'NOTICE.txt')
                            }
                        }
                    }
                </source>
            </configuration>
        </execution>
    </executions>
</plugin>

...

Code Block
<plugin>
    <groupId>org.codehaus.groovy.maven<gmaven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    <executions>
        <execution>
            <phase>generate-resources</phase>
            <goals>
                <goal>execute</goal>
            </goals>
            <configuration>
                <source>${pom.basedir}/src/main/script/myscript.groovy</source>
            </configuration>
        </execution>
    </executions>
</plugin>

...

Code Block
<plugin>
    <groupId>org.codehaus.groovy.maven<gmaven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    <executions>
        <execution>
            <phase>generate-resources</phase>
            <goals>
                <goal>execute</goal>
            </goals>
            <configuration>
                <source>http://mydomain.com/myscript.groovy</source>
            </configuration>
        </execution>
    </executions>
</plugin>

...

Code Block
<plugin>
    <groupId>org.codehaus.groovy.maven<gmaven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    <executions>
        <execution>
            <phase>generate-resources</phase>
            <goals>
                <goal>execute</goal>
            </goals>
            <configuration>
                <classpath>
                    <element>
                        <groupId>commons-lang</groupId>
                        <artifactId>commons-lang</artifactId>
                    </element>
                </classpath>
                <source>
                    import org.apache.commons.lang.SystemUtils
                    if (SystemUtils.IS_OS_WINDOWS) {
                        println('Go buy a Mac!')
                    }
                </source>
            </configuration>
        </execution>
    </executions>
</plugin>

...

Code Block
<plugin>
    <groupId>org.codehaus.groovy.maven<gmaven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    <executions>
        <execution>
            <phase>generate-resources</phase>
            <goals>
                <goal>execute</goal>
            </goals>
            <configuration>
                <scriptpath>
                    <element>${pom.basedir}/src/main/script</element>
                </scriptpath>
                <source>
                    import Helper
                    Helper.callSomeStatic()
                </source>
            </configuration>
        </execution>
    </executions>
</plugin>

...

Code Block
<plugin>
    <groupId>org.codehaus.groovy.maven<gmaven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    <executions>
        <execution>
            <phase>generate-resources</phase>
            <goals>
                <goal>execute</goal>
            </goals>
            <configuration>
                <properties>
                    <hello>world</hello>
                </properties>
                <source>
                    println project.properties['hello']

                                        // or if you prefer, these work just the same:
                    // println project.properties.hello
                    // println project.properties.get('hello')
                    // println project.properties.getProperty('hello')
                </source>
            </configuration>
        </execution>
    </executions>
</plugin>

...

Code Block
<plugin>
    <groupId>org.codehaus.groovy.maven<gmaven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    <executions>
        <execution>
            <phase>generate-resources</phase>
            <goals>
                <goal>execute</goal>
            </goals>
            <configuration>
                <defaults>
                    <hello>world</hello>
                </defaults>
                <source>
                    println project.properties['hello']
                </source>
            </configuration>
        </execution>
    </executions>
</plugin>

...