mirror of https://github.com/apache/maven.git
o Adding archetype for marmalade-mojo creation. this hasn't been thoroughly tested yet, because of a bug in model caching within the DefaultMavenProjectBuilder
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163844 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c3ad460669
commit
ff25b2fec0
|
@ -0,0 +1,11 @@
|
|||
<model>
|
||||
<parent>
|
||||
<artifactId>maven-archetypes</artifactId>
|
||||
<groupId>org.apache.maven.archetypes</groupId>
|
||||
<version>1.0-alpha-1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>maven-archetype-marmalade-mojo</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0-alpha-1-SNAPSHOT</version>
|
||||
</model>
|
|
@ -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,35 @@
|
|||
<model>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>${artifactId}</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
<version>${version}</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>marmalade</groupId>
|
||||
<artifactId>marmalade-core</artifactId>
|
||||
<version>1.0-alpha-2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>marmalade</groupId>
|
||||
<artifactId>marmalade-el-commons</artifactId>
|
||||
<version>1.0-alpha-2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>marmalade</groupId>
|
||||
<artifactId>marmalade-tags-io</artifactId>
|
||||
<version>1.0-alpha-2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<scriptSourceDirectory>src/main/resources</scriptSourceDirectory>
|
||||
</build>
|
||||
</model>
|
|
@ -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,20 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<mojo xmlns="marmalade:mojo">
|
||||
<metadata>
|
||||
<id>myMojo</id>
|
||||
<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