modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ClasspathInitializer.groovy | 2 modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy | 3 pom.xml | 171 +++++----- 3 files changed, 94 insertions(+), 82 deletions(-)
New commits: commit ca5e991eef94926a016a43500eac107051ebde44 Author: John Sanda jsanda@redhat.com Date: Tue Sep 7 16:52:03 2010 -0400
Putting build number generation plugins in profile to facilitate building in mead
We execute git during the build to generate some build properties, namely a build number. The git executable however is not available in the mead build environment. I have move the plugins involved with generating build properties into a profile so that we can disable them during builds in mead.
diff --git a/pom.xml b/pom.xml index 70c5254..497a520 100644 --- a/pom.xml +++ b/pom.xml @@ -604,85 +604,6 @@ </executions> </plugin>
- <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <id>write-build-time-properties-file</id> - <goals> - <goal>run</goal> - </goals> - <phase>generate-sources</phase> - <configuration> - <tasks> - <tstamp> - <format property="buildTime" pattern="MM/dd/yy hh:mm aa z" locale="en,US" timezone="GMT" /> - </tstamp> - <mkdir dir="target" /> - <echo file="target/build-time.properties" level="error">buildTime = ${buildTime}</echo> - </tasks> - </configuration> - </execution> - - <execution> - <id>echo-build-properties</id> - <phase>compile</phase> - <inherited>false</inherited> - <goals> - <goal>run</goal> - </goals> - <configuration> - <tasks> - <echo level="debug">buildTime = ${buildTime}</echo> - <echo level="debug">buildNumber = ${buildNumber}</echo> - </tasks> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <executions> - <execution> - <id>generate-build-number-properties</id> - <phase>generate-sources</phase> - <goals> - <goal>exec</goal> - </goals> - <configuration> - <executable>git</executable> - <arguments> - <argument>log</argument> - <argument>--pretty=format:buildNumber = %h</argument> - <argument>-n1</argument> - </arguments> - <outputFile>${project.build.directory}/build-number.properties</outputFile> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>properties-maven-plugin</artifactId> - <executions> - <execution> - <id>read-build-properties</id> - <phase>process-sources</phase> - <goals> - <goal>read-project-properties</goal> - </goals> - <configuration> - <files> - <file>${project.build.directory}/build-time.properties</file> - <file>${project.build.directory}/build-number.properties</file> - </files> - </configuration> - </execution> - </executions> - </plugin>
<plugin> <artifactId>maven-resources-plugin</artifactId> @@ -1083,6 +1004,98 @@ </build> </profile>
+ <profile> + <id>build-properties</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <build> + <plugins> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>write-build-time-properties-file</id> + <goals> + <goal>run</goal> + </goals> + <phase>generate-sources</phase> + <configuration> + <tasks> + <tstamp> + <format property="buildTime" pattern="MM/dd/yy hh:mm aa z" locale="en,US" + timezone="GMT"/> + </tstamp> + <mkdir dir="target"/> + <echo file="target/build-time.properties" level="error">buildTime = ${buildTime} + </echo> + </tasks> + </configuration> + </execution> + + <execution> + <id>echo-build-properties</id> + <phase>compile</phase> + <inherited>false</inherited> + <goals> + <goal>run</goal> + </goals> + <configuration> + <tasks> + <echo level="debug">buildTime = ${buildTime}</echo> + <echo level="debug">buildNumber = ${buildNumber}</echo> + </tasks> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <executions> + <execution> + <id>generate-build-number-properties</id> + <phase>generate-sources</phase> + <goals> + <goal>exec</goal> + </goals> + <configuration> + <executable>git</executable> + <arguments> + <argument>log</argument> + <argument>--pretty=format:buildNumber = %h</argument> + <argument>-n1</argument> + </arguments> + <outputFile>${project.build.directory}/build-number.properties</outputFile> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>properties-maven-plugin</artifactId> + <executions> + <execution> + <id>read-build-properties</id> + <phase>process-sources</phase> + <goals> + <goal>read-project-properties</goal> + </goals> + <configuration> + <files> + <file>${project.build.directory}/build-time.properties</file> + <file>${project.build.directory}/build-number.properties</file> + </files> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles>
commit 560767773837cf185c700cec5e4e3424e83d21fb Merge: 06b4a2c... 05f3a00... Author: John Sanda jsanda@redhat.com Date: Tue Sep 7 16:50:28 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 06b4a2c0fff9f975b213bc99b6f4e8efc37f3de5 Author: John Sanda jsanda@redhat.com Date: Tue Aug 24 13:54:35 2010 -0400
Updating ScriptRunner to add lib directories to script classpath
diff --git a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ClasspathInitializer.groovy b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ClasspathInitializer.groovy index 1c366d7..deb5001 100644 --- a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ClasspathInitializer.groovy +++ b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ClasspathInitializer.groovy @@ -1,7 +1,5 @@ package org.rhq.enterprise.server.plugins.groovy
-import org.codehaus.groovy.control.CompilerConfiguration - class ClasspathInitializer {
def initClasspath(String paths, String libDirs, scriptClassLoader) { diff --git a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy index 6c9c44d..d5b1af0 100644 --- a/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy +++ b/modules/enterprise/server/plugins/groovy-script/src/main/groovy/org/rhq/enterprise/server/plugins/groovy/ScriptRunner.groovy @@ -53,11 +53,12 @@ class ScriptRunner implements ServerPluginComponent, ControlFacet {
def scriptName = parameters.getSimpleValue("script", null) def paths = parameters.getSimpleValue("classpath", '') + def libDirs = parameters.getSimpleValue("libDirs", '')
log.debug("Preparing to execute script, $scriptName")
def scriptClassLoader = new GroovyClassLoader(Thread.currentThread().contextClassLoader, compilerConfig) - new ClasspathInitializer().initClasspath(paths, null, scriptClassLoader) + new ClasspathInitializer().initClasspath(paths, libDirs, scriptClassLoader)
def scriptRoots = new URL[1] scriptRoots[0] = new File(scriptName).toURI().toURL()
rhq-commits@lists.fedorahosted.org