Author: brett Date: Fri Dec 17 05:13:43 2004 New Revision: 122640 URL: http://svn.apache.org/viewcvs?view=rev&rev=122640 Log: maven 1.x plugin for modello
Added: maven/maven-1/plugins-sandbox/trunk/modello/ maven/maven-1/plugins-sandbox/trunk/modello/plugin.jelly (contents, props changed) maven/maven-1/plugins-sandbox/trunk/modello/project.xml (contents, props changed) maven/maven-1/plugins-sandbox/trunk/modello/src/ maven/maven-1/plugins-sandbox/trunk/modello/src/main/ maven/maven-1/plugins-sandbox/trunk/modello/src/main/org/ maven/maven-1/plugins-sandbox/trunk/modello/src/main/org/apache/ maven/maven-1/plugins-sandbox/trunk/modello/src/main/org/apache/maven/ maven/maven-1/plugins-sandbox/trunk/modello/src/main/org/apache/maven/plugins/ maven/maven-1/plugins-sandbox/trunk/modello/src/main/org/apache/maven/plugins/modello/ maven/maven-1/plugins-sandbox/trunk/modello/src/main/org/apache/maven/plugins/modello/ModelloCliWrapper.java (contents, props changed) Added: maven/maven-1/plugins-sandbox/trunk/modello/plugin.jelly Url: http://svn.apache.org/viewcvs/maven/maven-1/plugins-sandbox/trunk/modello/plugin.jelly?view=auto&rev=122640 ============================================================================== --- (empty file) +++ maven/maven-1/plugins-sandbox/trunk/modello/plugin.jelly Fri Dec 17 05:13:43 2004 @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/* + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed 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:define="jelly:define" xmlns:modello="modello"> + + <define:taglib uri="modello"> + <define:jellybean name="generate" method="generate" className="org.apache.maven.plugins.modello.ModelloCliWrapper" /> + </define:taglib> + + <goal name="modello" prereqs="modello:modello" /> + + <goal name="modello:modello" prereqs="modello:java,modello:xpp3" /> + + <goal name="modello:java"> + ${systemScope.setProperty('package', 'org.apache.maven.project')} + <modello:generate model="maven.mdo" type="java" packageWithVersion="false" version="3.0.0" targetDirectory="target/generated-sources" /> + </goal> + + <goal name="modello:xpp3"> + ${systemScope.setProperty('package', 'org.apache.maven.project')} + <modello:generate model="maven.mdo" type="xpp3-reader" packageWithVersion="false" version="3.0.0" targetDirectory="target/generated-sources" /> + <modello:generate model="maven.mdo" type="xpp3-writer" packageWithVersion="false" version="3.0.0" targetDirectory="target/generated-sources" /> + </goal> + +</project> Added: maven/maven-1/plugins-sandbox/trunk/modello/project.xml Url: http://svn.apache.org/viewcvs/maven/maven-1/plugins-sandbox/trunk/modello/project.xml?view=auto&rev=122640 ============================================================================== --- (empty file) +++ maven/maven-1/plugins-sandbox/trunk/modello/project.xml Fri Dec 17 05:13:43 2004 @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/* + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed 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> + <extend>../plugin-parent/project.xml</extend> + <artifactId>maven-modello-plugin</artifactId> + <name>Modello Plugin for Maven 1.0</name> + <currentVersion>0.9-SNAPSHOT</currentVersion> + <inceptionYear>2004</inceptionYear> + <siteAddress>maven.apache.org</siteAddress> + <siteDirectory>/www/maven.apache.org/reference/plugins/sandbox/modello/</siteDirectory> + <repository> + <connection>scm:cvs:pserver:[EMAIL PROTECTED]:/home/cvspublic:maven-plugins-sandbox/modello</connection> + <developerConnection>scm:cvs:ext:[EMAIL PROTECTED]:/home/cvs:maven-plugins-sandbox/modello</developerConnection> + <url>http://cvs.apache.org/viewcvs/maven-plugins-sandbox/modello</url> + </repository> + <developers> + <developer> + <name>Brett Porter</name> + <id>brett</id> + <email>[EMAIL PROTECTED]</email> + <organization>Fairfax Digital</organization> + <roles> + <role>Developer</role> + </roles> + <timezone>+10</timezone> + </developer> + </developers> + <dependencies> + <dependency> + <groupId>plexus</groupId> + <artifactId>plexus-container-api</artifactId> + <version>1.0-alpha-1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>plexus</groupId> + <artifactId>plexus-container-default</artifactId> + <version>1.0-alpha-1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>1.0-alpha-1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>modello</groupId> + <artifactId>modello-core</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>modello</groupId> + <artifactId>modello-xml-plugin</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>modello</groupId> + <artifactId>modello-xpp3-plugin</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>classworlds</groupId> + <artifactId>classworlds</artifactId> + <version>1.1-alpha-1</version> + </dependency> + </dependencies> +</project> Added: maven/maven-1/plugins-sandbox/trunk/modello/src/main/org/apache/maven/plugins/modello/ModelloCliWrapper.java Url: http://svn.apache.org/viewcvs/maven/maven-1/plugins-sandbox/trunk/modello/src/main/org/apache/maven/plugins/modello/ModelloCliWrapper.java?view=auto&rev=122640 ============================================================================== --- (empty file) +++ maven/maven-1/plugins-sandbox/trunk/modello/src/main/org/apache/maven/plugins/modello/ModelloCliWrapper.java Fri Dec 17 05:13:43 2004 @@ -0,0 +1,92 @@ +package org.apache.maven.plugins.modello; + +/* ==================================================================== + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed 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. + * ==================================================================== + */ + +import org.codehaus.modello.ModelloCli; + +/** + * @author <a href="mailto:[EMAIL PROTECTED]">Brett Porter</a> + * @version $Id: ArtifactDeployer.java,v 1.6 2004/09/06 04:26:10 felipeal Exp $ + */ +public class ModelloCliWrapper +{ + private String model; + private String packageWithVersion; + private String version; + private String type; + private String targetDirectory; + + public void generate() throws Exception + { + ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); + Thread.currentThread().setContextClassLoader( getClass().getClassLoader() ); + String[] args = new String[] { model, type, targetDirectory, version, packageWithVersion }; + ModelloCli.main( args ); + Thread.currentThread().setContextClassLoader( oldClassLoader ); + } + + public String getModel() + { + return this.model; + } + + public String getPackageWithVersion() + { + return this.packageWithVersion; + } + + public String getVersion() + { + return this.version; + } + + public String getType() + { + return this.type; + } + + public String getTargetDirectory() + { + return this.targetDirectory; + } + + public void setModel( String model ) + { + this.model = model; + } + + public void setPackageWithVersion( String packageWithVersion ) + { + this.packageWithVersion = packageWithVersion; + } + + public void setVersion( String version ) + { + this.version = version; + } + + public void setType( String type ) + { + this.type = type; + } + + public void setTargetDirectory( String targetDirectory ) + { + this.targetDirectory = targetDirectory; + } +} --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
