mirror of https://github.com/apache/maven.git
o adding marmalade archetype
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@294963 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
66052540c1
commit
cdb8f1d8bb
|
@ -0,0 +1,10 @@
|
|||
<project>
|
||||
<parent>
|
||||
<artifactId>maven-archetypes</artifactId>
|
||||
<groupId>org.apache.maven.archetypes</groupId>
|
||||
<version>1.0-alpha-4-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>maven-archetype-marmalade-mojo</artifactId>
|
||||
<version>1.0-alpha-4-SNAPSHOT</version>
|
||||
</project>
|
|
@ -0,0 +1,11 @@
|
|||
<archetype>
|
||||
<id>mmld-plugin</id>
|
||||
<sources>
|
||||
<source>src/main/java/CopyFileTag.java</source>
|
||||
<source>src/main/java/MyMojoTagLibrary.java</source>
|
||||
</sources>
|
||||
<resources>
|
||||
<resource>src/main/resources/META-INF/marmalade/myMojo.def</resource>
|
||||
<resource>src/main/resources/myMojo.mmld</resource>
|
||||
</resources>
|
||||
</archetype>
|
|
@ -0,0 +1,40 @@
|
|||
<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/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>${artifactId}</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
<version>${version}</version>
|
||||
<name>Maven Marmalade Mojo Archetype</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0-beta-2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>marmalade</groupId>
|
||||
<artifactId>marmalade-core</artifactId>
|
||||
<version>1.0-alpha-4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>marmalade</groupId>
|
||||
<artifactId>marmalade-el-commons</artifactId>
|
||||
<version>1.0-alpha-3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>marmalade</groupId>
|
||||
<artifactId>marmalade-tags-io</artifactId>
|
||||
<version>1.0-alpha-3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-script-marmalade</artifactId>
|
||||
<version>2.0-beta-2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<scriptSourceDirectory>src/main/resources</scriptSourceDirectory>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,36 @@
|
|||
package $package;
|
||||
|
||||
/*
|
||||
* Copyright 2001-2005 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.marmalade.model.AbstractMarmaladeTag;
|
||||
import org.codehaus.marmalade.runtime.MarmaladeExecutionContext;
|
||||
import org.codehaus.marmalade.runtime.MarmaladeExecutionException;
|
||||
|
||||
/**
|
||||
* @author jdcasey
|
||||
*/
|
||||
public class CopyFileTag
|
||||
extends AbstractMarmaladeTag
|
||||
{
|
||||
|
||||
protected void doExecute(MarmaladeExecutionContext context)
|
||||
throws MarmaladeExecutionException
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package $package;
|
||||
|
||||
/*
|
||||
* Copyright 2001-2005 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.marmalade.metamodel.AbstractMarmaladeTagLibrary;
|
||||
|
||||
/**
|
||||
* @author jdcasey
|
||||
*/
|
||||
public class MyMojoTagLibrary
|
||||
extends AbstractMarmaladeTagLibrary
|
||||
{
|
||||
|
||||
public MyMojoTagLibrary()
|
||||
{
|
||||
registerTag( "copyFile", CopyFileTag.class );
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
${package}.MyMojoTagLibrary
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<mojo xmlns="marmalade:mojo">
|
||||
<metadata>
|
||||
<goal>myMojo</goal>
|
||||
<description>Output a file with specified contents to [outputDirectory]/touch.txt</description>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
<expression>${project.build.directory}</expression>
|
||||
<description>Output directory for files.</description>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</metadata>
|
||||
<execute>
|
||||
<io:file xmlns:io="marmalade:io" path="${outputDirectory}/touch.txt" mkdirs="true">touch.txt</io:file>
|
||||
<m:copyFile xmlns:m="marmalade:myMojo" source="${outputDirectory}/touch.txt" target="${outputDirectory}/touch2.txt"/>
|
||||
</execute>
|
||||
</mojo>
|
Loading…
Reference in New Issue