1

I am developing Java Spring MVC application built upon Maven and I would like to compile SOY templates stored within the 'resources/soy' directory to JavaScript files that could be accessed via presentation tier. This could be done manually using SoyToJsSrcCompiler, however, it would be nice to find a way of how to process templates automatically during project compilation. I have found a plugin, that should be able to do the trick, however, I could not make it work (no results nor errors are produced):

<pluginRepositories>
    <pluginRepository>
        <id>soy-maven-plugin</id>
        <url>http://wibidata.github.com/soy-maven-plugin/repo</url>
    </pluginRepository>
</pluginRepositories>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.odiago.maven.plugins</groupId>
            <artifactId>soy-maven-plugin</artifactId>
            <version>1.0.0</version>
            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <inputFiles>
                    <!-- This is where my templates really are... -->
                    <directory>${basedir}/src/main/resources/soy</directory>
                    <includes>
                        <include>**/*.soy</include>
                    </includes>
                </inputFiles>
            </configuration>
        </plugin>
    </plugins>
</build>

How could this be done in a straightforward way? Preferably without usage of third party plugins?

Thanks is advance!

Sezi
  • 73
  • 8
  • Using third-party plugins actually _is_ the preferred way to do things Maven doesn't support natively. Can you supply the relevant parts of the build output, i.e. all lines in context with the `soy-maven-plugin` and the build result. – Gerold Broser Sep 18 '15 at 19:34
  • It makes me wonder that the address http://wibidata.github.com/soy-maven-plugin/repo mentioned on the [usage page](http://wibidata.github.io/soy-maven-plugin/1.0.0/usage.html) returns a _404 File not found._ – Gerold Broser Sep 18 '15 at 19:38
  • Not that this is the problem, but `basedir` is deprecated in favour of `project.basedir`. See [Maven Model Builder, Model Interpolation](https://maven.apache.org/ref/3.3.3/maven-model-builder/). – Gerold Broser Sep 18 '15 at 19:52

0 Answers0