Coder Social home page Coder Social logo

string-template-maven-plugin's People

Contributors

kevinbirch avatar rwicke avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

string-template-maven-plugin's Issues

Alternate delimiters (e.g. $ instead of <>)

Hi,

Thanks for writing this. Is it possible to change the delimiters used by the plugin, by specifying alternate delimiters in the configuration? The STGroup constructor allows you to specify alternate delimiters, and the string template documentation has several examples where $$ is used as the delimiter instead of <>. I want to generate xml, which makes the default very cumbersome.

Thanks.

Don't make the directory absolute if it doesn't exist

StringTemplate allows loading templates from the classpath which is useful because I can bundle them in a jar and add that as a dependency to the plugin invocation. E.g.:

<groupId>com.webguys</groupId>
<artifactId>string-template-maven-plugin</artifactId>
<version>1.1</version>
<dependencies>
  <dependency>
    <groupId>foo.bar</groupId>
    <artifactId>templates</artifactId>
    <version>1.0</version>
  </dependency>
</dependencies>
<configuration>
  <templates>
    <template>
      <directory>foo/bar/templates/</directory>
      <name>MyAweseomeTemplate</name>
      ...
    </template>
  </templates>
<configuration>

However, StringTemplate uses either the context classloader or the classloader used for loading stringtemplate, and this requires that the directory entry above is a non-absolute resource path (i.e. no leading slash). However the stringtemplate plugin takes that to mean a relative directory which it expands without checking whether that actually exists.
Ideally, the plugin would check if the expanded directory exists, and if not, leave the value unmodified.

Controller nonsense

  1. When only only <properties> named element values are needed, it is pointless having to provide, at least an extra 4 lines for , a element in the pom.xml, for each template! The plugin should use a stub controller when there is no controller element.
  2. Having to specify the controller compiler source/target version values is stupidly redundant, because these should be got, by default, from the pom.xml "maven.compiler.*" properties e.g.:
    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

Put Controller source code and Resource to separate folder

Hi,

Currently we have to put our Controller code in the src/main/java. Is there any way to put the controller source code some where else, so that it will not be compiled and packed in the package.

Another problem is about resource used by controller. We don't want it been packed. Our use cases is we have some big text file from unicode standard, and we need to generate some classes and test classes based on it. The string template is simple but the controller code need to read and parse the text file.

Thanks,

incompatibility with Maven 3.3.3

[ERROR] Failed to execute goal com.webguys:string-template-maven-plugin:1.1:render (default) on project STT: Execution default of goal com.webguys:string-template-maven-plugin:1.1:render failed: An API incompatibility was encountered while executing com.webguys:string-template-maven-plugin:1.1:render: java.lang.NoSuchMethodError: org.apache.maven.execution.MavenSession.getRepositorySession()Lorg/sonatype/aether/RepositorySystemSession;

Name collisions in properties doesn't generate a list type in string template.

Hi Kevin,

I don't know if this considered a bug or not. In the usage page, it said: "N.B. The properties are installed into the template after the results of the controller, so if there are any name collisions then the value type will be automatically converted into a list type by StringTemplate."

But when I put two property with same name in the secion, only the last one's value showed. I think the "name collisions" in the document only means collision between controller and properties.

I saw we use Set to hold properties, may be change it to List could resolve the problem.

Regards

Rendering uses the platform default charset

Hello!

I'm running into issues on some of my builds where the input template is UTF-8, but the platform upon which the plugin is executing uses a different charset. This line seems to be the culprit:

FileWriter fileWriter = new FileWriter(outputFile);

I think the plugin should respect one of the various charset-related Maven properties, if they're defined.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.