summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xqpid/java/common/generate6
-rw-r--r--qpid/java/common/pom.xml33
-rw-r--r--qpid/java/plugins/pom.xml29
-rw-r--r--qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java54
-rw-r--r--qpid/java/pom.xml49
5 files changed, 137 insertions, 34 deletions
diff --git a/qpid/java/common/generate b/qpid/java/common/generate
index 87ddf53868..d9ea47aeca 100755
--- a/qpid/java/common/generate
+++ b/qpid/java/common/generate
@@ -2,13 +2,9 @@
# Interim code generation script.
-import sys, os
+import sys, os, mllib
from cStringIO import StringIO
-sys.path.append("../../python")
-
-import mllib
-
out_dir=sys.argv[1]
out_pkg = sys.argv[2]
spec_file = sys.argv[3]
diff --git a/qpid/java/common/pom.xml b/qpid/java/common/pom.xml
index 792a7f38f4..69a68461c0 100644
--- a/qpid/java/common/pom.xml
+++ b/qpid/java/common/pom.xml
@@ -41,11 +41,12 @@
<generated.package>org/apache/qpid/framing</generated.package>
<generated.dir>${generated.path}/${generated.package}</generated.dir>
<generated.timestamp>${generated.dir}/timestamp</generated.timestamp>
- <specs.dir>${topDirectoryLocation}/../specs</specs.dir>
+ <specs.dir>${basedir}/../../specs</specs.dir>
+ <mllib.dir>${basedir}/../../python</mllib.dir>
</properties>
<build>
- <plugins>
+ <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
@@ -57,12 +58,12 @@
<tasks>
<echo>"${generated.path}"</echo>
<ant antfile="protocol-version.xml" />
- <exec executable="python">
+<!-- <exec executable="python">
<arg line="generate"/>
<arg line="${generated.path}"/>
<arg line="org.apache.qpidity"/>
<arg line="${specs.dir}/amqp-transitional.0-10.xml"/>
- </exec>
+ </exec> -->
</tasks>
<sourceRoot>${generated.path}</sourceRoot>
</configuration>
@@ -73,6 +74,30 @@
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>jython-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>jython</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <params>
+ <param>-Dpython.cachedir.skip=true</param>
+ <param>-Dpython.path=${basedir}/jython-lib.jar/Lib:${mllib.dir}</param>
+ <param>${basedir}/generate</param>
+ <param>${generated.path}</param>
+ <param>org.apache.qpidity</param>
+ <param>${specs.dir}/amqp-transitional.0-10.xml</param>
+ </params>
+ </configuration>
+ <goals>
+ <goal>jython</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
<!-- Backports the module to Java 1.4. This is done during the packaging phase as a transformation of the Jar. -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
diff --git a/qpid/java/plugins/pom.xml b/qpid/java/plugins/pom.xml
new file mode 100644
index 0000000000..f913f0b2c3
--- /dev/null
+++ b/qpid/java/plugins/pom.xml
@@ -0,0 +1,29 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>jython-plugin</artifactId>
+ <packaging>maven-plugin</packaging>
+ <version>1.0-incubating-M2-SNAPSHOT</version>
+ <name>Jython Launcher</name>
+
+ <parent>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>qpid</artifactId>
+ <version>1.0-incubating-M2-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.python</groupId>
+ <artifactId>jython</artifactId>
+ <version>2.2-rc1</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java b/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java
new file mode 100644
index 0000000000..1788f471d7
--- /dev/null
+++ b/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.plugins;
+
+import java.io.File;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+import org.python.util.jython;
+
+
+/**
+ * JythonMojo
+ *
+ * @author Rafael H. Schloming
+ *
+ * @goal jython
+ */
+
+public class JythonMojo extends AbstractMojo
+{
+
+ /**
+ * Arguments to jython.
+ *
+ * @parameter
+ */
+ private String[] params = new String[0];
+
+ public void execute() throws MojoExecutionException
+ {
+ jython.main(params);
+ }
+
+}
diff --git a/qpid/java/pom.xml b/qpid/java/pom.xml
index 87ed34846f..ede9ee553f 100644
--- a/qpid/java/pom.xml
+++ b/qpid/java/pom.xml
@@ -147,6 +147,7 @@ under the License.
</properties>
<modules>
+ <module>plugins</module>
<module>common</module>
<module>broker</module>
<module>client</module>
@@ -155,9 +156,8 @@ under the License.
<module>perftests</module>
<module>integrationtests</module>
<module>management/eclipse-plugin</module>
- <module>client/example</module>
- <module>client-java14</module>
-
+ <module>client/example</module>
+ <module>client-java14</module>
</modules>
@@ -391,28 +391,27 @@ under the License.
<version>0.5</version>
</plugin>
- <plugin>
- <artifactId>maven-remote-resources-plugin</artifactId>
- <version>1.0-alpha-5</version>
- <executions>
- <execution>
- <goals>
- <goal>process</goal>
- </goals>
- <configuration>
- <resourceBundles>
- <resourceBundle>org.apache:apache-incubator-disclaimer-resource-bundle:1.1</resourceBundle>
- <resourceBundle>org.apache:apache-jar-resource-bundle:1.2</resourceBundle>
- </resourceBundles>
- <properties>
- <addLicense>true</addLicense>
- <projectName>Apache Qpid</projectName>
- </properties>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
+ <plugin>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <version>1.0-alpha-5</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ <configuration>
+ <resourceBundles>
+ <resourceBundle>org.apache:apache-incubator-disclaimer-resource-bundle:1.1</resourceBundle>
+ <resourceBundle>org.apache:apache-jar-resource-bundle:1.2</resourceBundle>
+ </resourceBundles>
+ <properties>
+ <addLicense>true</addLicense>
+ <projectName>Apache Qpid</projectName>
+ </properties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</pluginManagement>