talios / coffee-maven-plugin Goto Github PK
View Code? Open in Web Editor NEWApache Maven Plugin for Coffeescript
Apache Maven Plugin for Coffeescript
Add support for joining sets of .coffee files into a single .js file.
Small issue that's not really worth a fork and pull request.
In the READEME.md
file line 10 (<version>1.1.3/version>
) should be changed to <version>1.1.3</version>
.
I have tried setting the `' tag to compile individually, but it doesn't seem to make a difference in the output. The console does report messages like:
[INFO] Compiling File accounts.coffee in JoinSet:main
[INFO] Compiling File app_error.coffee in JoinSet:main
so I know the setting is being read correctly, but I still get just one output js file, main.js
for the JoinSet shown above.
Here is my plugin config:
<plugin>
<groupId>com.theoryinpractise</groupId>
<artifactId>coffee-maven-plugin</artifactId>
<version>1.4.7</version>
<configuration>
<version>1.6.1</version>
<coffeeOutputDirectory>${basedir}/js</coffeeOutputDirectory>
<compileIndividualFiles>true</compileIndividualFiles>
<coffeeJoinSets>
<joinSet>
<id>main</id>
<fileSet>
<directory>${basedir}/coffee</directory>
<includes>
<include>**/*.coffee</include>
</includes>
</fileSet>
</joinSet>
<joinSet>
<id>test</id>
<coffeeOutputDirectory>${basedir}/test/specs/js</coffeeOutputDirectory>
<fileSet>
<directory>${basedir}/test/specs/coffee</directory>
<includes>
<include>**/*.coffee</include>
</includes>
</fileSet>
</joinSet>
</coffeeJoinSets>
</configuration>
<executions>
<execution>
<id>coffee</id>
<goals>
<goal>coffee</goal>
</goals>
</execution>
</executions>
</plugin>
Hi!
Omitting the coffeeJoinSets leads to a NullPointerException. I know this is a usage error, but that should not lead to an hard NullPointer. A human readable error message would be better.
I consider this as especially important because this plugin is still new and you won't find much help and documentation on the net.
Greetings
treeno
Remove the current dependency on jcoffeescript-1.1.jar, re implement the running of coffee script inside the plugin and make it somehow possible to update the coffee compiler external to the plugin.
Can we get an option to delete the old files after the unified and minified version has been created?
Thanks a lot.
When I try to transpile with the newer version 1.6.3 of CoffeeScript I receive the error:
[ERROR] Failed to execute goal com.theoryinpractise:coffee-maven-plugin:1.4.7:coffee (coffee) on project timer: Unsupported version of coffee-script specified (1.6.3) - supported versions: 1.2.0, 1.3.1, 1.3.3, 1.4.0, 1.5.0, 1.6.1 -> [Help 1]
When using this plugin in Eclipse with m2e, you get "Plugin execution not covered by lifecycle". This makes the plugin unusable in Eclipse; even if you add a custom lifecycle mapping, the plugin continually recompiles. Some small changes to the plugin will prevent this, allowing Eclipse devs to benefit from your work.
There is a good page here: http://wiki.eclipse.org/M2E_compatible_maven_plugins
which describes the steps necessary. Essentially:
You can see an example of the XML here: https://github.com/marceloverdijk/lesscss-maven-plugin/blob/master/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml
The page has some examples of using BuildContext, but here's a real example: https://github.com/marceloverdijk/lesscss-maven-plugin/blob/master/src/main/java/org/lesscss/mojo/CompileMojo.java
Is there a way to configure the plugin to just in-place replace the coffeescript files in place? For example-
webapp
--->js
---->someSubFolder
------>someFile.coffee
would be built in the build directory as
webapp
--->js
---->someSubFolder
------>someFile.js
It may make sense to allow more than one coffeeDir so that you can allow for both src/main/coffee and also coffee files in src/main/webapp. That way the scripts can either live alongside the web app files in their appropriate subdirectories (views of controllers, for example) or more like Java source code.
The compiler fails to compile files from nested subdirectories when the target directory doesn't exist.
i.e.
/src/main/coffee/some/deep/dir/foo.coffee
I write some scripts in "src/main/coffee" and some scripts in "src/main/coffee/component". When use coffee-maven-plugin, all scripts are compiled to "target/coffee", directory "component" is not keeped.
So, coffee compile output need keep the directory "component"
I want eclipse build coffeescript auto & incremental. So I add following config:
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.theoryinpractise</groupId>
<artifactId>coffee-maven-plugin</artifactId>
<versionRange>[1.4.7,)</versionRange>
<goals>
<goal>coffee</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>true</runOnIncremental>
</execute>
</action>
</pluginExecution>
It works, but when I save a file, even not a .coffee file, then all coffee files are compiled again(It takes a long time. During the time, eclipse always show "Build workspace (xx%)").
So I want coffee-maven-plugin support incremental build. If a .coffee file is not changed and the compiled .js file exist, then skip the compile.
I am using lesscss-maven-plugin too, it works fine, then source code is here(https://github.com/marceloverdijk/lesscss-maven-plugin/blob/master/src/main/java/org/lesscss/mojo/CompileMojo.java).
Thanks very much.
Is this plugin somewhere available in a public maven repo?
I noticed version 1.1.3 in Maven Central, but https://github.com/talios/coffee-maven-plugin mentions 1.4.0...
-w, --watch Watch the modification times of the coffee-scripts, recompiling as soon as a change occurs.
This seems like an obvious question: since the order of files in a JS library is critical, am I missing a way to specify the order in which the plugin adds files to the join sets and/or minifiy process?
I'm defining a fileset, with the includes in the proper order. But the plugin just builds the final JS file in alphabetical order (by directory, then file). I've tried everything I can think of, including a separate fileset for every file, but nothing works. Is there really no way to specify the order of the included files?
v1.1.1 works. but v1.1.2 fail.
<plugin>
<groupId>com.theoryinpractise</groupId>
<artifactId>coffee-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>coffee</goal>
</goals>
</execution>
</executions>
<configuration>
<coffeeDir>${basedir}/src/main/webapp</coffeeDir>
<outputDirectory>${basedir}/src/main/webapp</outputDirectory>
</configuration>
</plugin>
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building frontend 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- coffee-maven-plugin:1.1.2:coffee (default-cli) @ frontend ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.508s
[INFO] Finished at: Tue Aug 02 01:17:25 CST 2011
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.theoryinpractise:coffee-maven-plugin:1.1.2:coffee (default-cli) on project frontend: null: MojoExecutionException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.theoryinpractise:coffee-maven-plugin:1.1.2:coffee (default-cli) on project frontend: null
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException
at com.theoryinpractise.coffeescript.CoffeeScriptCompilerMojo.execute(CoffeeScriptCompilerMojo.java:95)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Could we create the destiny folder during compile?
Thanks you.
I found an Article (http://www.theoryinpractice.net/post/44612719290/coffee-maven-plugin-1-4-7) That describes the Source Maps support of your plugin, but I cannot find any documentation about that. Am I mixing up plugins, or did you forget do document that feature here on github?
Greetings
treeno
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.