maven pom: put apache cloudstack tools together in umbrella pom minor pom refactor to put all the tools under one placeholder pom. Also adds a profile for marvin to run deployDataCenter via mvn options.
$mvn -Pdeveloper,marvin -pl :cloud-marvin -Dmarvin.config=<path/to/config> OR $cd tools/marvin $mvn -Pmarvin -pl :cloud-marvin -Dmarvin.config=path/to/config will deploy the datacenter using the marvin.config property's value Signed-off-by: Prasanna Santhanam <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/05437d0e Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/05437d0e Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/05437d0e Branch: refs/heads/qemu-img Commit: 05437d0e975562c9aff25415ed0b9681b702b6af Parents: 1dd4051 Author: Prasanna Santhanam <[email protected]> Authored: Fri Feb 15 20:45:32 2013 +0530 Committer: Prasanna Santhanam <[email protected]> Committed: Fri Feb 15 20:53:41 2013 +0530 ---------------------------------------------------------------------- developer/pom.xml | 117 ++------------------------ pom.xml | 117 ++++++++++++++++++++++++- tools/apidoc/pom.xml | 12 +-- tools/cli/pom.xml | 4 +- tools/devcloud-kvm/pom.xml | 2 +- tools/devcloud/pom.xml | 2 +- tools/marvin/marvin/deployDataCenter.py | 8 +- tools/marvin/pom.xml | 66 ++++++++++----- tools/pom.xml | 44 ++++++++++ 9 files changed, 216 insertions(+), 156 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/05437d0e/developer/pom.xml ---------------------------------------------------------------------- diff --git a/developer/pom.xml b/developer/pom.xml index 79b2466..81bb3ff 100644 --- a/developer/pom.xml +++ b/developer/pom.xml @@ -27,7 +27,12 @@ <version>5.1.21</version> <scope>runtime</scope> </dependency> - + <dependency> + <groupId>org.apache.cloudstack</groupId> + <artifactId>cloud-plugin-hypervisor-simulator</artifactId> + <version>${project.version}</version> + <scope>compile</scope> + </dependency> </dependencies> <build> <defaultGoal>install</defaultGoal> @@ -189,114 +194,6 @@ </build> </profile> - <!-- Simulator profile --> - <profile> - <id>simulator</id> - <activation> - <property> - <name>deploydb-simulator</name> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>properties-maven-plugin</artifactId> - <version>1.0-alpha-2</version> - <executions> - <execution> - <phase>initialize</phase> - <goals> - <goal>read-project-properties</goal> - </goals> - <configuration> - <files> - <file>${project.parent.basedir}/utils/conf/db.properties</file> - <file>${project.parent.basedir}/utils/conf/db.properties.override</file> - </files> - <quiet>true</quiet> - </configuration> - </execution> - </executions> - </plugin> - <!-- DatabaseCreator driver here --> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <version>1.2.1</version> - <dependencies> - <!-- specify the dependent jdbc driver here --> - <dependency> - <groupId>mysql</groupId> - <artifactId>mysql-connector-java</artifactId> - <version>${cs.mysql.version}</version> - </dependency> - <dependency> - <groupId>commons-dbcp</groupId> - <artifactId>commons-dbcp</artifactId> - <version>${cs.dbcp.version}</version> - </dependency> - <dependency> - <groupId>commons-pool</groupId> - <artifactId>commons-pool</artifactId> - <version>${cs.pool.version}</version> - </dependency> - <dependency> - <groupId>org.jasypt</groupId> - <artifactId>jasypt</artifactId> - <version>${cs.jasypt.version}</version> - </dependency> - <dependency> - <groupId>org.apache.cloudstack</groupId> - <artifactId>cloud-utils</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.cloudstack</groupId> - <artifactId>cloud-server</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - <executions> - <execution> - <phase>process-resources</phase> - <id>create-schema</id> - <goals> - <goal>java</goal> - </goals> - </execution> - </executions> - <configuration> - <includeProjectDependencies>false</includeProjectDependencies> - <includePluginDependencies>true</includePluginDependencies> - <executableDependency> - <groupId>org.apache.cloudstack</groupId> - <artifactId>cloud-server</artifactId> - </executableDependency> - <mainClass>com.cloud.upgrade.DatabaseCreator</mainClass> - <arguments> - <!-- db properties file --> - <argument>${project.parent.basedir}/utils/conf/db.properties</argument> - <argument>${project.parent.basedir}/utils/conf/db.properties.override</argument> - <!-- simulator sql files --> - <argument>${basedir}/target/db/create-schema-simulator.sql</argument> - <argument>${basedir}/target/db/templates.simulator.sql</argument> - <!-- database upgrade--> - <argument>com.cloud.upgrade.DatabaseUpgradeChecker</argument> - <argument>--database=simulator</argument> - <argument>--rootpassword=${db.root.password}</argument> - <!-- enable verbosity by -v or dash-dash-verbose --> - </arguments> - <systemProperties> - <systemProperty> - <key>catalina.home</key> - <value>${project.parent.basedir}/utils</value> - </systemProperty> - </systemProperties> - </configuration> - </plugin> - </plugins> - </build> - </profile> + </profiles> </project> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/05437d0e/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 820e938..eb7a790 100644 --- a/pom.xml +++ b/pom.xml @@ -504,13 +504,12 @@ </profile> <profile> <id>developer</id> + <properties> + <marvin.config>tools/devcloud/devcloud.cfg</marvin.config> + </properties> <modules> <module>developer</module> - <module>tools/apidoc</module> - <module>tools/devcloud</module> - <module>tools/devcloud-kvm</module> - <module>tools/marvin</module> - <module>tools/cli</module> + <module>tools</module> </modules> </profile> <profile> @@ -524,5 +523,113 @@ <module>vmware-base</module> </modules> </profile> + <profile> + <id>simulator</id> + <activation> + <property> + <name>deploydb-simulator</name> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>properties-maven-plugin</artifactId> + <version>1.0-alpha-2</version> + <executions> + <execution> + <phase>initialize</phase> + <goals> + <goal>read-project-properties</goal> + </goals> + <configuration> + <files> + <file>${project.basedir}/utils/conf/db.properties</file> + <file>${project.basedir}/utils/conf/db.properties.override</file> + </files> + <quiet>true</quiet> + </configuration> + </execution> + </executions> + </plugin> + <!-- DatabaseCreator driver here --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>1.2.1</version> + <dependencies> + <!-- specify the dependent jdbc driver here --> + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <version>${cs.mysql.version}</version> + </dependency> + <dependency> + <groupId>commons-dbcp</groupId> + <artifactId>commons-dbcp</artifactId> + <version>${cs.dbcp.version}</version> + </dependency> + <dependency> + <groupId>commons-pool</groupId> + <artifactId>commons-pool</artifactId> + <version>${cs.pool.version}</version> + </dependency> + <dependency> + <groupId>org.jasypt</groupId> + <artifactId>jasypt</artifactId> + <version>${cs.jasypt.version}</version> + </dependency> + <dependency> + <groupId>org.apache.cloudstack</groupId> + <artifactId>cloud-utils</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.cloudstack</groupId> + <artifactId>cloud-server</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> + <executions> + <execution> + <phase>process-resources</phase> + <id>create-schema</id> + <goals> + <goal>java</goal> + </goals> + </execution> + </executions> + <configuration> + <includeProjectDependencies>false</includeProjectDependencies> + <includePluginDependencies>true</includePluginDependencies> + <executableDependency> + <groupId>org.apache.cloudstack</groupId> + <artifactId>cloud-server</artifactId> + </executableDependency> + <mainClass>com.cloud.upgrade.DatabaseCreator</mainClass> + <arguments> + <!-- db properties file --> + <argument>${project.basedir}/utils/conf/db.properties</argument> + <argument>${project.basedir}/utils/conf/db.properties.override</argument> + <!-- simulator sql files --> + <argument>${basedir}/target/db/create-schema-simulator.sql</argument> + <argument>${basedir}/target/db/templates.simulator.sql</argument> + <!-- database upgrade--> + <argument>com.cloud.upgrade.DatabaseUpgradeChecker</argument> + <argument>--database=simulator</argument> + <argument>--rootpassword=${db.root.password}</argument> + <!-- enable verbosity by -v or dash-dash-verbose --> + </arguments> + <systemProperties> + <systemProperty> + <key>catalina.home</key> + <value>${project.basedir}/utils</value> + </systemProperty> + </systemProperties> + </configuration> + </plugin> + </plugins> + </build> + </profile> </profiles> </project> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/05437d0e/tools/apidoc/pom.xml ---------------------------------------------------------------------- diff --git a/tools/apidoc/pom.xml b/tools/apidoc/pom.xml index 6b159ff..7358b92 100644 --- a/tools/apidoc/pom.xml +++ b/tools/apidoc/pom.xml @@ -12,22 +12,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>cloud-apidoc</artifactId> - <name>Apache CloudStack apidoc Tools</name> + <name>Apache CloudStack apidocs</name> <packaging>pom</packaging> <parent> <groupId>org.apache.cloudstack</groupId> <artifactId>cloudstack</artifactId> <version>4.1.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> + <relativePath>../pom.xml</relativePath> </parent> - <dependencies> - <dependency> - <groupId>org.apache.cloudstack</groupId> - <artifactId>cloud-client-ui</artifactId> - <version>${project.version}</version> - <type>war</type> - </dependency> - </dependencies> <properties> <client.config.base>../../client/target/cloud-client-ui-4.1.0-SNAPSHOT/WEB-INF/</client.config.base> <client.config.jars>${client.config.base}/lib</client.config.jars> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/05437d0e/tools/cli/pom.xml ---------------------------------------------------------------------- diff --git a/tools/cli/pom.xml b/tools/cli/pom.xml index d99d6fb..5f14d7c 100644 --- a/tools/cli/pom.xml +++ b/tools/cli/pom.xml @@ -20,13 +20,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>cloud-cli</artifactId> - <name>Apache CloudStack Developer Tools: cloudmonkey cli</name> + <name>Apache CloudStack cloudmonkey cli</name> <packaging>pom</packaging> <parent> <groupId>org.apache.cloudstack</groupId> <artifactId>cloudstack</artifactId> <version>4.1.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> + <relativePath>../pom.xml</relativePath> </parent> <build> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/05437d0e/tools/devcloud-kvm/pom.xml ---------------------------------------------------------------------- diff --git a/tools/devcloud-kvm/pom.xml b/tools/devcloud-kvm/pom.xml index e90a257..d4e12e4 100644 --- a/tools/devcloud-kvm/pom.xml +++ b/tools/devcloud-kvm/pom.xml @@ -18,7 +18,7 @@ <groupId>org.apache.cloudstack</groupId> <artifactId>cloudstack</artifactId> <version>4.1.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> + <relativePath>../pom.xml</relativePath> </parent> <dependencies> <dependency> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/05437d0e/tools/devcloud/pom.xml ---------------------------------------------------------------------- diff --git a/tools/devcloud/pom.xml b/tools/devcloud/pom.xml index cbf93a4..5257cb8 100644 --- a/tools/devcloud/pom.xml +++ b/tools/devcloud/pom.xml @@ -18,7 +18,7 @@ <groupId>org.apache.cloudstack</groupId> <artifactId>cloudstack</artifactId> <version>4.1.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> + <relativePath>../pom.xml</relativePath> </parent> <dependencies> <dependency> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/05437d0e/tools/marvin/marvin/deployDataCenter.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py index e4f7eac..cec920c 100644 --- a/tools/marvin/marvin/deployDataCenter.py +++ b/tools/marvin/marvin/deployDataCenter.py @@ -19,16 +19,16 @@ import configGenerator import cloudstackException import cloudstackTestClient -import sys -import os import logging from cloudstackAPI import * +from os import path from optparse import OptionParser class deployDataCenters(): def __init__(self, cfgFile): - if not os.path.exists(cfgFile): + if not path.exists(cfgFile) \ + and not path.exists(path.abspath(cfgFile)): raise IOError("config file %s not found. please specify a valid config file"%cfgFile) self.configFile = cfgFile @@ -444,7 +444,7 @@ if __name__ == "__main__": parser = OptionParser() - parser.add_option("-i", "--intput", action="store", \ + parser.add_option("-i", "--input", action="store", \ default="./datacenterCfg", dest="input", help="the path \ where the json config file generated, by default is \ ./datacenterCfg") http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/05437d0e/tools/marvin/pom.xml ---------------------------------------------------------------------- diff --git a/tools/marvin/pom.xml b/tools/marvin/pom.xml index 51c70cd..f5561ca 100644 --- a/tools/marvin/pom.xml +++ b/tools/marvin/pom.xml @@ -12,15 +12,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>cloud-marvin</artifactId> - <name>Apache CloudStack Developer Tools: marvin</name> + <name>Apache CloudStack marvin</name> <packaging>pom</packaging> <parent> <groupId>org.apache.cloudstack</groupId> - <artifactId>cloudstack</artifactId> + <artifactId>cloud-tools</artifactId> <version>4.1.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> + <relativePath>../pom.xml</relativePath> </parent> - <build> <defaultGoal>install</defaultGoal> <plugins> @@ -29,14 +28,15 @@ <version>1.7</version> <executions> <execution> - <id>generate-resource</id> - <phase>generate-resources</phase> + <id>clean</id> + <phase>clean</phase> <goals> <goal>run</goal> </goals> <configuration> <target> - <delete dir="marvin/cloudstackAPI"/> + <delete dir="marvin/cloudstackAPI"/> + <echo>Deleting ${project.artifactId} API sources</echo> </target> </configuration> </execution> @@ -54,12 +54,13 @@ <goal>exec</goal> </goals> <configuration> - <workingDirectory>marvin</workingDirectory> + <workingDirectory>${basedir}/marvin</workingDirectory> <executable>python</executable> <arguments> <argument>codegenerator.py</argument> <argument>-s</argument> <argument>${basedir}/../apidoc/target/commands.xml</argument> + <echo>Generating ${project.artifactId} API classes}</echo> </arguments> </configuration> </execution> @@ -78,23 +79,42 @@ </arguments> </configuration> </execution> - <execution> - <id>deploy</id> - <phase>deploy</phase> - <goals> - <goal>exec</goal> - </goals> + </executions> + + </plugin> + </plugins> + </build> + <profiles> + <profile> + <id>marvin</id> + <activation> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>1.2.1</version> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>exec</goal> + </goals> + </execution> + </executions> <configuration> - <workingDirectory>dist</workingDirectory> - <executable>pip</executable> + <workingDirectory>${basedir}/marvin</workingDirectory> + <executable>python</executable> <arguments> - <argument>install</argument> - <argument>Marvin-0.1.0.tar.gz</argument> + <argument>deployDataCenter.py</argument> + <argument>-i</argument> + <argument>${user.dir}/${marvin.config}</argument> </arguments> </configuration> - </execution> - </executions> - </plugin> - </plugins> -</build> + </plugin> + </plugins> + </build> + </profile> + </profiles> </project> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/05437d0e/tools/pom.xml ---------------------------------------------------------------------- diff --git a/tools/pom.xml b/tools/pom.xml new file mode 100644 index 0000000..982306f --- /dev/null +++ b/tools/pom.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ 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. + --> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <name>Apache CloudStack Developer Tools</name> + <groupId>org.apache.cloudstack</groupId> + <artifactId>cloud-tools</artifactId> + <packaging>pom</packaging> + <parent> + <groupId>org.apache.cloudstack</groupId> + <artifactId>cloudstack</artifactId> + <version>4.1.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <build> + <defaultGoal>install</defaultGoal> + </build> + <modules> + <module>apidoc</module> + <module>marvin</module> + <module>cli</module> + <module>devcloud</module> + <module>devcloud-kvm</module> + </modules> +</project>
