Closed patjlm closed 9 years ago
Sorry for the previous failed builds... i am not yet used to github/travis/coveralls/... The ant-nodeps jar was added in 'compile' scope. I guess you'd prefer in 'provided'. Please let me know if you want me to push this.
This is cool, but I think it should be a separate project. I don't particularly want to maintain an Ant plugin, and there's no special benefit to having it in the main JMustache project (other than saving you time and spending my time; great for you, not so great for me).
You can create a standalone project which bundles jmustache.jar with your MustacheFilter and ships a single jar that people can use in their Ant build pretty easily. Just copy your code out into a separate project and use this POM as a starting point:
<?xml version="1.0" encoding="UTF-8"?>
<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>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>5</version>
</parent>
<groupId>com.samskivert</groupId>
<artifactId>jmustache-ant</artifactId>
<packaging>jar</packaging>
<version>1.11-SNAPSHOT</version>
<name>jmustache-ant</name>
<description>A filter which allows JMustache to be used in Ant.</description>
<url>http://github.com/patjlm/jmustache-ant</url>
<issueManagement>
<url>http://github.com/patjlm/jmustache-ant/issues</url>
</issueManagement>
<licenses>
<license>
<name>The (New) BSD License</name>
<url>http://www.opensource.org/licenses/bsd-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>samskivert</id>
<name>Michael Bayne</name>
<email>mdb@samskivert.com</email>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/patjlm/jmustache-ant.git</connection>
<developerConnection>scm:git:git@github.com:patjlm/jmustache-ant.git</developerConnection>
<url>http://github.com/patjlm/jmustache-ant</url>
</scm>
<dependencies>
<dependency>
<groupId>com.samskivert</groupId>
<artifactId>jmustache</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-nodeps</artifactId>
<version>1.7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<fork>true</fork>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<compilerArgs>
<arg>-Xlint</arg>
<arg>-Xlint:-serial</arg>
<arg>-Xlint:-path</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.2</version>
<configuration>
<includes><include>**/*Test.java</include></includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<quiet>true</quiet>
<show>public</show>
<additionalparam>-Xdoclint:all -Xdoclint:-missing</additionalparam>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.5</version>
</plugin>
<!-- include our depends (jmustache) in the final jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<!-- put your configurations here -->
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- these handle code coverage -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.6</version>
<configuration>
<format>xml</format>
<maxmem>256m</maxmem>
</configuration>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>2.1.0</version>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property><name>performRelease</name><value>true</value></property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<keyname>mdb@samskivert.com</keyname>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
You'll want to change the places where my name appears to your name, and then if you want to publish to Maven Cental, then you'll need to go through that rigamarole (or using something like bintray). If you do want to publish it, then you'll need to change the groupId from com.samskivert
.
Then you can put your README at the top-level and it will make sense to someone trying to use the project. All the instructions on how to use it will be in the expected place, rather than hiding down in some secret source code directory.
I'm happy to link to the project from the JMustache README once everything is set up.
Here's a jar of the full standalone project:
https://www.dropbox.com/s/3voj1b1a6p57q6c/ant-jmustache.jar?dl=0
Thanks! I'll do that.
This new class allows to use JMustache inside Ant scripts, using the Ant fitering capabilities. As far as I know there are no Ant support for Mustache templates out there. Putting this class in JMustache directly would allow ant users to use a single jar to benefit from Mustache templating, which is one of the benefit of JMustache (no other dependencies). Up to you to see if you want to add this support in your project. Note that ant.jar is needed at compile time for this new task (added in pom.xml). Of course not needed at runtime as already available within the ant execution context. A README.md was created in the source to provide user install/usage guidance.