Giter VIP home page Giter VIP logo

closure-compiler-maven-plugin's Introduction

Closure Compiler Maven Plugin

Forked from Minify Maven Plugin. That project seems to be inactive. In line with the principle of single responsibility, this fork is meant only for processing JavaScript files. The YUI Compressor is dead, so what remains is a maven plugin for Google Closure Compiler. I found some plugins for the closure compiler, but found them all to be lacking - by not having a recent version of closure compile, not exposing many of its options or not handling files well. So I decided to fork the excellent Minify Maven Plugin as a base for a closure compiler maven plugin.

This plugin combines and minimizes JavaScript files. It produces a merged and a minified version.

Requires at least Java 11.

Notes regarding changes and updates

  • Closure compiler is pretty stable right now and rarely adds completely new features. It seems to concentrate on stability and bug fixes. I'll update closure compiler every few months. If you need an update immediately for a particular bug fix, feel free to open an issue.
  • There are many low-level options in closure compiler, most of which are not exposed by this plugin, as I do not have any use case. If you are missing an option, also feel free to open an issue.

Usage

Configure your project's pom.xml to run the plugin during the project's build cycle.

<build>
  
  <!-- Exclude the sources in "src/main/resources/includes" -->
  <!-- Include the transpiled files in "target/generated-resources/includes" -->
  <resources>
    <resource>
      <directory>${project.basedir}/src/main/resources</directory>
      <excludes>
        <exclude>includes/**/*.js</exclude>
      </excludes>
      </resource>
      <resource>
        <directory>${project.basedir}/target/generated-resources</directory>
      </resource>
  </resources>
  
  <!-- Transpiled all sources from               -->
  <!--     "src/main/resources/includes"         -->
  <!--  to                                       -->
  <!--     "target/generated-resources/includes" -->
  <plugins>
    <plugin>
      <groupId>com.github.blutorange</groupId>
      <artifactId>closure-compiler-maven-plugin</artifactId>
      <version>${closure-compiler-maven-plugin.version}</version>
      <configuration>
        <!-- Base configuration for all executions (bundles) -->
        <baseSourceDir>${project.basedir}/src/main/resources</baseSourceDir>
        <baseTargetDir>${project.build.directory}/generated-resources</baseTargetDir>
      </configuration>
      <executions>
        <!-- Process all files in the "includes" directory individually-->
        <execution>
          <id>default-minify</id>
          <configuration>
            <encoding>UTF-8</encoding>
            <sourceDir>includes</sourceDir>
            <targetDir>includes</targetDir>
            <includes>
              <include>**/*.js</include>
            </includes>
            <skipMerge>true</skipMerge>
            <closureLanguageOut>ECMASCRIPT5</closureLanguageOut>
          </configuration>
          <goals>
            <goal>minify</goal>
          </goals>
          <phase>generate-resources</phase>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

Documentation

For more information, check the documentation or the test projects.

Paths, directories and files

To process our files, we need to know where they are located and where we want the output to go to. This sound simple, but it gets more complicated as you also want files to be ordered the right way, use wild cards, have relative paths, create source maps etc. This is short explanation of how file handling works with this plugin.

Any transpilation process consists of two main ingredients: The source (or input) files; and the target (or output) files. First we need to establish the base directory, which needs to be an absolute path on the file system:

  • baseSourceDir: The absolute path of the direcotry with the input files. Usually the source file of our project, eg. ${project.basedir}/src/webapp
  • baseTargetDir: The absolute path of the directory with the output files. Usually the target directory of our maven project, eg. ${project.basedir}/target/generated-resources

For larger projects, we may want to run closure compiler multiple times on different sets of files. We can do this with multiple executions of this plugin. But as we are still working within the same project, we don't want to set the absolute path to our project each and every time. For each execution, we only want to specify a relative path:

  • sourceDir: The path to the directory with the source files, relative to the baseSourceDir.
  • targetDir: The path to the directory with the source files, relative to the baseTargetDir.

Next, we want to specify some actual files to process:

  • includes: List of files to include. This is relative to the sourceDir. Wildcards are allowed. Eg. **/*.js
  • excludes: List of files to exclude. This is relative to the sourceDir. Wildcards are allowed. Eg. do_not_process.js

So how are these source files ordered? We could take all includes and excludes, figure out all matching files, and sort them alphabetically. But this means we could not specify the order of files manually if we ever needed it. On the other hand, when we use wild cards to specify a set of files, we probably want these to be sorted. To get the best of both world, this plugin orders files like this:

  • For each <include>, find all files matching the wildcard pattern (observing the <excludes>).
  • For each <include>, sort the matching files alphabetically.
  • Then add the matching files for each include in the order the <include>s were specified.

Another thing to mention here is how the files are passed to closure compiler. Closure compiler never reads files from the files system itself. When ES modules are used, it does not look in the file system for the imported files. It expects that we give it all the inpt files it needs. To pass a source file to closure compiler, we need to give it the content of the file, as well as a (possibly relative) path to the file. If we pass the wrong path, closure compiler may not be able to resolve reference between files. This plugin always uses the path of a source file on the file system, relative to the sourceDir. So if we set the baseSourceDir to /home/john/git/project/src/webapp and sourceDir to js; and have a file at /home/john/git/project/src/webapp/js/logic/model.js: the file is passed to closure compiler with the file name logic/model.js By doing it this way, we also get closure compiler to "just work" with node.js projects: We just need to set the source directory to the main directory of the node project (with the node_modules folder) and set closureModuleResolution to NODE.

Finally, we want to tell the plugin where to place the output file(s). There are two cases here, depending on whether we want to merge all input files into once large file; or just process each file separately and place these files into the target directory:

  • skipMerge: If true, process each file individually. Otherwise, merge all source files.
  • outputFilename: The location of the output file, relative to the targetDir. When we merge all files, we usually want to specify an fixed name, eg. bundle.min.js. When we skip the merge process, we can use variables to customize the directory and file name. The default here is #{path}/#{basename}.min.#{extension}, which uses the original filename with a .min before the extension, and preserves the directory structure of the input files. See the linked documentation for more details.

As a bonus, we may sometimes want to create a source map as well. The easiest and quickest way to get working source maps is to:

This includes the entire source map as well as the original source file content in the minified file itself. As soon as the browser loads the minfied file, it's got everything it needs and the source map feature just works. Now in case we do not like our source maps being that large, we need to keep the source map as a separate file. That involves several paths:

  • The path from the minified file to the source map (so the browser can find it)
  • The path from the source map to the minified file (which is part of the source map)
  • The path from the source map to the original source files (so the browser can find them)

Before we can worry about that, we need to specify where to put the generated source map:

  • closureSourceMapName: Path and file name of the source map, relative to the directory of the outputFilename.

Now we can worry about the paths mentioned above. The first two are easy: we know the location of the minified file and the source map files, so we just use the corresponding relative paths. And normally, both the minified file and the source map are put inside the same directory.

The last one - the path from the source map to the original source files - is not quite as easy. The source map is generated by closure compiler and by default, closure compiler just uses the name of the source file as it was passed to it: that is, relative to the sourceDir This usually won't work, because the source map is placed in the targetDir, so the relative path won't be correct. Fortunately, closure compiler offer an option to remap the location of (path to the) source files when it creates the source map. By default, this plugin sets this option so that the paths are correct with respect to the underlying file system. So for example, if we set

  • the source directory to /home/john/git/project/src/webapp
  • the target directory to /home/john/git/project/target/generated-sources
  • the includes to js/index.js
  • the output file name to bundle.min.js
  • the source map file name to bundle.min.map.js

Then we get the two output files

  • /home/john/git/project/target/generated-sources/bundle.min.js and
  • /home/john/git/project/target/generated-sources/bundle.min.map.js

The source map bundle.min.map.js now references the source files as ../../src/webapp/js/index.js. When your project directory structure resembles your directory structure on the server, then by default, every will just work. If the directory structure is diffrent, closure compiler offers the option source_map_location_mapping. For this plugin, this is set with the option:

  • closureSourceMapLocationMappings: When the file name of a source file contains the given prefix, it is replaced with the specified replacement. Here the file name is as it was passed to closure compiler, i.e. relative to the sourceDir

For the example above, this means that the source file name would be js/index.js. We could now set this option to replace js/ with https://example.com/sources/. Now the source map contains a reference to the source file as https://example.com/sources/index.js.

Build site

  • Edit files in /src/site
  • mvn clean report:report site
    • You can check out the locally rendered rendered site in target/site/index.html.
  • To upload to github, add the profile site
    • mvn clean report:report site -P site

Release

  • mvn versions:display-dependency-updates
  • Update version in pom.xml and src/test/resources/projects/parent/pom.xml.
  • Update CHANGELOG.md
  • Generate site, check links
  • Upload site to github (see above)
  • Upload source to github
  • mvn clean install
  • mvn -P release deploy

Test

The test projects need a built version of the plugin, so make a full local build first:

mvn clean install -DskipTests

You may need to run an install on a test project first to download the required dependencies:

cd src/test/resources/projects/minimal/
mvn install
cd ../../../../../

Now test away

mvn clean package test

To run only a single test for debugging, use

# nameOfTestMethod is one of the methods annotated with @Test in MinifyMojoTest
# For example: testOutputFilename
mvn test -Dtest=MinifyMojoTest#nameOfTestMethod

To add a new test, go to src/test/resources/projects/, copy one of the test projects as a base (except parent). Open the pom.xml and change the artifactId to a new name. Edit the closure compiler configuration as necessary. Add input JavaScript files to the directory test and the expected output files to the directory expected. Finally open MinifyMojoTest and add a new test method:

  @Test
  public void testMyproject() throws Exception {
    runMinify("myproject");
  }

License

This distribution is licensed under the terms of the Apache License, Version 2.0 (see LICENSE.txt).

closure-compiler-maven-plugin's People

Contributors

afaust avatar andreasrosdal avatar awa-xima avatar blutorange avatar dcendents avatar dms-it avatar gabrielsjoberg avatar hboylan avatar i045053 avatar krudolph avatar madisparn avatar mbme avatar samaxes avatar samcday avatar spodgurskiy avatar sps avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

closure-compiler-maven-plugin's Issues

Why webappSourceDir and cssSourceDir?

Issue by aibar
Tuesday Jan 19, 2016 at 12:05 GMT
Originally opened as samaxes#115


It's confusing. Why not only cssSourceDir and default value for it "${basedir}/src/main/webapp/css". In our project we have separate module for styles, it's not webapp and webappSourceDir is meaningless. And for target it's the same, we have webappTargetDir and relative cssTargetDir.

Paths in project with multiple modules

Issue by user20161119
Friday Dec 02, 2016 at 10:13 GMT
Originally opened as samaxes#134


I put bundle.json in src/main/resource

image

and my css and js folders are in src/main/webapp

image

I tried src/main/webapp/css/xx.css and css/xx.css but neither work in the process of package phase,and said not found xx.css xx.js

Debug message as follow:
image
the file location is correct,but can not compress.

Remove order by filename.

Issue by scarballo
Tuesday Jun 19, 2018 at 10:32 GMT
Originally opened as samaxes#159


Remove order by filename in class method "ProcessFilesTask.getFilesToInclude". The plugin should keep the original order to make it usable. In case of javascript files, user should put the files in the correct order before using the plugin to avoid javascript errors. The same case for css files, normally, the files are put on websites in order.


scarballo included the following code: https://github.com/samaxes/minify-maven-plugin/pull/159/commits

Log Level should be adjustable on plugin level

Issue by zbug
Wednesday Apr 26, 2017 at 06:05 GMT
Originally opened as samaxes#144


Hi,

Could you please add an option to mute or reduce the log output of the minify-maven-plugin?

It currently creates 3 lines of log entries per JS file, e.g.

[INFO] Creating the minified file [Formatter.js].
[INFO] Uncompressed size: 1365 bytes.
[INFO] Compressed size: 526 bytes minified (259 bytes gzipped).

This is a matter of optimisation for us as we slowly lose overview of what's actually relevant in our logs. I do not see, how any of the logged information could be of use when logged for each single file in every single build.

Thanks

closureCreateSourceMap: sourceMappingUrl link not generated on rebuild

Issue by tekhedd
Wednesday Apr 12, 2017 at 18:44 GMT
Originally opened as samaxes#142


Using minify-maven-plugin 1.7.6.

When rebuilding a project using closureCreateSourceMap, the sourceMappingUrl is correctly generated on a clean build, but not inserted into the minified file on a rebuild.

My tests indicate that the //#sourceMappingUrl will be generated only if the original .js.map file does not exist. In other words, if I run

mvn clean ; mvn package

sourceMappingUrl is present.
If I run 'mvn package' again without cleaning, sourceMappingUrl is missing.

If I manually remove target/exploded-dir/merged.min.js.map and then run 'mvn package' again, the sourceMappingUrl is generated.

The timestamp on the .map file is not changed, so it appears that closure is failing to regenerate it, hence the missing sourceMappingUrl line.

Workaround? Explicitly delete the source map file as part of the build, or always explicitly clean the target before deploying. (The target always runs regardless of whether it needs to be rebuilt, so in netbeans "clean and build" followed by "run" results in no map file.)

Note: all mvn runs performed with "-e" "-DskipTests" for this experiment. Hope this helps.

File names have been changed to protect the innocent.

   <plugin>
        <groupId>com.samaxes.maven</groupId>
        <artifactId>minify-maven-plugin</artifactId>
        <version>1.7.6</version>
        <executions>
            <execution>
                <id>minify</id>
                <phase>process-resources</phase>
                <goals>
                    <goal>minify</goal>
                </goals>
                <configuration>
                    <charset>UTF-8</charset>

                    <cssTargetDir>css</cssTargetDir>
                    <cssFinalFile>style.css</cssFinalFile>
                    
                    <cssSourceDir>css</cssSourceDir>
                    <cssSourceFiles>
                               ...
                    </cssSourceFiles>
                    
                    <jsTargetDir>.</jsTargetDir>
                    <jsFinalFile>final.js</jsFinalFile>
                    <closureCreateSourceMap>true</closureCreateSourceMap>
                    <nosuffix>false</nosuffix>
                    
                    <jsSourceDir>.</jsSourceDir>
                    <!-- <jsSourceIncludes>*.js</jsSourceIncludes> -->
                    <jsSourceFiles>
                             ...
                    </jsSourceFiles>
                    
                    <jsEngine>CLOSURE</jsEngine>
                    <closureCompilationLevel>SIMPLE_OPTIMIZATIONS</closureCompilationLevel>
                    <closureCreateSourceMap>true</closureCreateSourceMap>
                </configuration>
            </execution>
        </executions>
    </plugin>`

Append new line to scripts before merge

Issue by woodgoblin
Wednesday Jul 01, 2015 at 14:03 GMT
Originally opened as samaxes#105


I have some third-party scripts, loaded via bower, that I'd not rather touch.
The problem is that some of'em are ended with commented lines.
So merge gives an erroneous script as a result.
It will be great to have a option to append new line after each script as part of a merge.

multiple target folder for minified css and js files

Issue by leosignking
Friday Jan 13, 2017 at 22:32 GMT
Originally opened as samaxes#136


I am working on a project where I need to minify multiple js and css files and copy to different directories. How do I achieve it? I used "cssTargetDir" but all the minified will be moved to one directory instead, I need the minified to copy to different folders.

src/main/resources/static/css/1.css
src/main/resources/static/css/2.css

src/main/resources/static/js/1.js
src/main/resources/static/js/2.js

Final out directory

target/web-resources/assets/js/1/1.min.js
target/web-resources/assets/js/2/2.min.js

Exception 'Failed to concatenate files' raised in linux build

Issue by GregDomjan
Thursday Mar 23, 2017 at 00:24 GMT
Originally opened as samaxes#139


Had issue with our desired layout, came up with solution to get files to root folder when running build on Windows
<jsTargetDir>js/..</jsTargetDir> <!-- if empty takes the jsSourceDir value -->

When running build on Linux for clean build get the following issue - doesn't happen on subsequent non-clean build.

[INFO] Processing source file [foo.js].
[ERROR] Failed to concatenate files.
java.io.FileNotFoundException: /home/someapp/target/someapp-0.0.1-0-SNAPSHOT/js/../mergedfoo.js (No such file or directory)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.(FileOutputStream.java:213)
at java.io.FileOutputStream.(FileOutputStream.java:162)
at com.samaxes.maven.minify.plugin.ProcessFilesTask.merge(ProcessFilesTask.java:203)
at com.samaxes.maven.minify.plugin.ProcessFilesTask.call(ProcessFilesTask.java:175)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Is there a better way to address the jsTarget to the root rather than a subfolder and not match the jsSourceDir?

java.lang.ClassNotFoundException: com.google.javascript.jscomp.CompilerOptions$LanguageMode

Issue by jieryn
Thursday Dec 15, 2016 at 17:44 GMT
Originally opened as samaxes#135


Most recent version, and older, of minify-m-p fails with about to be released Apache Maven 3.4.0:

Maven information:

[INFO] --- maven-enforcer-plugin:1.4.1:display-info (display-info) @ project ---
[INFO] Maven Version: 3.4.0-SNAPSHOT
[INFO] JDK Version: 1.8.0_111 normalized as: 1.8.0-111
[INFO] OS Info: Arch: amd64 Family: unix Name: linux Version: 3.10.0-514.el7.x86_64

Build failure:

[ERROR] Failed to execute goal com.samaxes.maven:minify-maven-plugin:1.7.6:minify (default-minify) on project ui: Execution default-minify of goal com.samaxes.maven:minify-maven-plugin:1.7.6:minify failed: A required class was missing while executing com.samaxes.maven:minify-maven-plugin:1.7.6:minify: Lcom/google/javascript/jscomp/CompilerOptions$LanguageMode;
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>com.samaxes.maven:minify-maven-plugin:1.7.6
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/jenkins/.m2/repository/com/samaxes/maven/minify-maven-plugin/1.7.6/minify-maven-plugin-1.7.6.jar
[ERROR] urls[1] = file:/home/jenkins/.m2/repository/com/google/code/gson/gson/2.3.1/gson-2.3.1.jar
[ERROR] urls[2] = file:/home/jenkins/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[project>com.acme:project:0.10-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
[ERROR] 
[ERROR] -----------------------------------------------------: com.google.javascript.jscomp.CompilerOptions$LanguageMode
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.samaxes.maven:minify-maven-plugin:1.7.6:minify (default-minify) on project ui: Execution default-minify of goal com.samaxes.maven:minify-maven-plugin:1.7.6:minify failed: A required class was missing while executing com.samaxes.maven:minify-maven-plugin:1.7.6:minify: Lcom/google/javascript/jscomp/CompilerOptions$LanguageMode;
-----------------------------------------------------
realm =    plugin>com.samaxes.maven:minify-maven-plugin:1.7.6
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/home/jenkins/.m2/repository/com/samaxes/maven/minify-maven-plugin/1.7.6/minify-maven-plugin-1.7.6.jar
urls[1] = file:/home/jenkins/.m2/repository/com/google/code/gson/gson/2.3.1/gson-2.3.1.jar
urls[2] = file:/home/jenkins/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[project>com.acme:project:0.10-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]

-----------------------------------------------------

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:214)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:155)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:147)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:195)
        at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:191)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-minify of goal com.samaxes.maven:minify-maven-plugin:1.7.6:minify failed: A required class was missing while executing com.samaxes.maven:minify-maven-plugin:1.7.6:minify: Lcom/google/javascript/jscomp/CompilerOptions$LanguageMode;
-----------------------------------------------------
realm =    plugin>com.samaxes.maven:minify-maven-plugin:1.7.6
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/home/jenkins/.m2/repository/com/samaxes/maven/minify-maven-plugin/1.7.6/minify-maven-plugin-1.7.6.jar
urls[1] = file:/home/jenkins/.m2/repository/com/google/code/gson/gson/2.3.1/gson-2.3.1.jar
urls[2] = file:/home/jenkins/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[project>com.acme:project:0.10-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]

-----------------------------------------------------

        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:168)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 11 more
Caused by: org.apache.maven.plugin.PluginContainerException: A required class was missing while executing com.samaxes.maven:minify-maven-plugin:1.7.6:minify: Lcom/google/javascript/jscomp/CompilerOptions$LanguageMode;
-----------------------------------------------------
realm =    plugin>com.samaxes.maven:minify-maven-plugin:1.7.6
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/home/jenkins/.m2/repository/com/samaxes/maven/minify-maven-plugin/1.7.6/minify-maven-plugin-1.7.6.jar
urls[1] = file:/home/jenkins/.m2/repository/com/google/code/gson/gson/2.3.1/gson-2.3.1.jar
urls[2] = file:/home/jenkins/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[project>com.acme:project:0.10-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]

-----------------------------------------------------

        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:166)
        ... 12 more
Caused by: java.lang.NoClassDefFoundError: Lcom/google/javascript/jscomp/CompilerOptions$LanguageMode;
        at java.lang.Class.getDeclaredFields0(Native Method)
        at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
        at java.lang.Class.getDeclaredFields(Class.java:1916)
        at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:675)
        at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:380)
        at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:165)
        at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:616)
        at com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:572)
        at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:558)
        at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:887)
        at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:808)
        at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:285)
        at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:217)
        at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:1009)
        at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1041)
        at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1004)
        at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1054)
        at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
        at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
        at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
        at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:65)
        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
        at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
        at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)
        at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
        at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1019)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1015)
        at org.eclipse.sisu.inject.Guice4$1.get(Guice4.java:162)
        at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
        at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:515)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:121)
        ... 12 more
Caused by: java.lang.ClassNotFoundException: com.google.javascript.jscomp.CompilerOptions$LanguageMode
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
        ... 48 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/PluginContainerException

Issue in merging java-script source files in a particular order

Issue by kannan08
Friday May 19, 2017 at 07:16 GMT
Originally opened as samaxes#146


<jsSourceIncludes>
                                    <jsSourceInclude>UIApp.js</jsSourceInclude>
                                    <jsSourceInclude>UIApp.run.js</jsSourceInclude>
                                    <jsSourceInclude>UI-i18n.config.js</jsSourceInclude>
                                    <jsSourceInclude>UI-router-helper.provider.js</jsSourceInclude>
 <jsSourceInclude>aa/nnn/r.js</jsSourceInclude>
 <jsSourceInclude>aa/nnn/a.js</jsSourceInclude>
<jsSourceIncludes>
We need it should merge what order we mention in the <jsSourceInclude> but it always short by fileName


Feature Request - Closure configuration option setTrustedStrings()

Issue by lambcode
Wednesday Jul 19, 2017 at 14:46 GMT
Originally opened as samaxes#148


When running the Closure Compiler from the command line, the option setTrustedStrings defaults to true but when running the compiler from this plugin, the option is set to false. Not having this option set will convert some characters shuch as '<' and '>' to '\x3c' and '\x3d'. This bloats the resulting minified file.

Could a plugin configuration option be added to set this Closure Compiler option?

Missing closureLanguageOut "ES_2017"

Issue by OzoneGrif
Wednesday Oct 11, 2017 at 11:42 GMT
Originally opened as samaxes#153


Hello Samaxes,

I have an issue with my project which can be solved by using the string "ES_2017" for closureLanguageOut.
That will disable some transcriptions and polyfills for ECMASCRIPT 6.

Is it possible to add it to the plugin?

Substituting <script> tags in HTML with merged values

Issue by Adhara3
Friday Feb 20, 2015 at 15:41 GMT
Originally opened as samaxes#88


I thing this plugin does a great job but this feature is, IMHO, missing and makes the merge feature less usable.
I saw that you created the bundle feature in 1.7.5 (great!) and that could be the starting point to substitute in the HTML files the old css/js script/link tags with the new ones.
In my scenario I have a single page app with only one HTML containing all the imports. I am using Angular JS which is best managed with several js files (50+).
It would be great to bundle all of them into a single file and change the script tag so that I only import that single file. That would improve performances a lot!

It is a nice to have, but nothing really critical since, while the HTTP request for 50+ files may be not ideal, for single page apps this is performed only once.

Thanks
Andrea

CSS minification/aggregation breaks percent measures

Issue by nicStuff
Wednesday Mar 29, 2017 at 12:05 GMT
Originally opened as samaxes#140


With version 1.7.6, and the following configuration

{ "bundles": [ { "type": "css", "name": "aaa.css", "files": [ "percent.css" ] } ] }

And the file percent.css being body { font-family:Arial, Helvetica, sans-serif; font-size:75.0%; color:#000; background:#cdcdcd; }

the resulting file "aaa.css" is body{font-family:Arial,Helvetica,sans-serif;font-size:75.0;color:#000;background:#cdcdcd}.

The percent sign has been lost in the process.

Merge source and include types so order can be preserved

Issue by nedjs
Friday Mar 20, 2015 at 00:03 GMT
Originally opened as samaxes#93


When aggregating multiple files some of which are already minified and shouldn't be hit with a 2nd round you might do the following

<jsSourceFiles>
    <jsSourceFile>app.js</jsSourceFile>
    <jsSourceFile>zones.js</jsSourceFile>
</jsSourceFiles>
<jsIncludeFiles>
    <jsIncludeFile>jquery.min.js</jsIncludeFile>
</jsIncludeFiles>

What happens is the source files get minified then merged with items listed inside jsIncludeFiles as expected from the documentation. The output file would be an aggregation of the files in the following order:

  • app.js
  • jquery.min.js
  • zones.js

Of course if you have any JQuery references in app.js then your going to have problems.


You might solve this by changing the xml structure to allow for includes and sources to be under the same tree. However I dont know how your code is operating behind the scenes so maybe a different option is more feasible.

Something like this:

<jsFiles>
    <jsIncludeFile>jquery.min.js</jsIncludeFile>
    <jsSourceFile>app.js</jsSourceFile>
    <jsSourceFile>zones.js</jsSourceFile>
</jsFiles>

IndexOutOfBoundsException Using YUI Compressor engine on empty js code

Issue by sandrogiacom
Wednesday Oct 04, 2017 at 18:54 GMT
Originally opened as samaxes#152


When js file is empty (only comments) this exception occur. Ex:

๏ปฟ/*
This is content
*/

java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at com.samaxes.maven.minify.plugin.MinifyMojo.execute(MinifyMojo.java:465)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
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:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.getToken(JavaScriptCompressor.java:578)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSymbolTree(JavaScriptCompressor.java:1094)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.compress(JavaScriptCompressor.java:556)
at com.samaxes.maven.minify.plugin.ProcessJSFilesTask.minify(ProcessJSFilesTask.java:170)
at com.samaxes.maven.minify.plugin.ProcessFilesTask.call(ProcessFilesTask.java:164)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Could not map source location: The filename, directory name, or volume label syntax is incorrect

There seems to be an issue with the file system on Windows:

[ERROR] Could not map source location
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
    at java.io.WinNTFileSystem.canonicalize0 (Native Method)
    at java.io.WinNTFileSystem.canonicalize (WinNTFileSystem.java:428)
    at java.io.File.getCanonicalPath (File.java:618)
    at com.github.blutorange.maven.plugin.closurecompiler.common.FileHelper.relativizePath (FileHelper.java:19)
    at com.github.blutorange.maven.plugin.closurecompiler.common.FileSystemLocationMapping.map (FileSystemLocationMapping.java:37)
    at com.google.javascript.jscomp.SourceMap.fixupSourceLocation (SourceMap.java:221)
    at com.google.javascript.jscomp.SourceMap.addSourceFile (SourceMap.java:202)
    at com.google.javascript.jscomp.Compiler.addFilesToSourceMap (Compiler.java:3359)
    at com.google.javascript.jscomp.Compiler.parseSyntheticCode (Compiler.java:2071)
    at com.google.javascript.jscomp.Compiler.ensureLibraryInjected (Compiler.java:3256)
    at com.google.javascript.jscomp.Compiler.ensureLibraryInjected (Compiler.java:3271)
    at com.google.javascript.jscomp.Compiler.ensureLibraryInjected (Compiler.java:3271)
    at com.google.javascript.jscomp.InjectRuntimeLibraries.process (InjectRuntimeLibraries.java:40)
    at com.google.javascript.jscomp.Compiler.transpileAndDontCheck (Compiler.java:985)
    at com.google.javascript.jscomp.Compiler.performChecksAndTranspilation (Compiler.java:816)
    at com.google.javascript.jscomp.Compiler.lambda$stage1Passes$0 (Compiler.java:749)
    at com.google.javascript.jscomp.CompilerExecutor$2.call (CompilerExecutor.java:102)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
    at java.lang.Thread.run (Thread.java:745)

Plugin configuration:

			<plugin>
				<groupId>com.github.blutorange</groupId>
				<artifactId>closure-compiler-maven-plugin</artifactId>
				<configuration>
					<charset>UTF-8</charset>
					<closureWarningLevels>
						<misplacedTypeAnnotation>OFF</misplacedTypeAnnotation>
						<es5Strict>OFF</es5Strict>
						<unknownDefines>OFF</unknownDefines>
						<nonStandardJsDocs>OFF</nonStandardJsDocs>
						<uselessCode>OFF</uselessCode>
					</closureWarningLevels>
					<closureCompilationLevel>${closure.compilation.level}</closureCompilationLevel>
					<closurePrettyPrint>true</closurePrettyPrint>
					<closureIncludeSourcesContent>true</closureIncludeSourcesContent>
					<closureSourceMapOutputType>inline</closureSourceMapOutputType>
					<closureCreateSourceMap>true</closureCreateSourceMap>
					<closureDebug>true</closureDebug>
					<closureLanguageIn>ECMASCRIPT_2018</closureLanguageIn>
					<closureLanguageOut>ECMASCRIPT5</closureLanguageOut>
					<baseSourceDir>${basedir}/src/main/es6</baseSourceDir>
					<baseTargetDir>${project.build.directory}/generated-resources/js</baseTargetDir>
				</configuration>
				<executions>
					<!-- External or third-party JavaScript libraries -->
					<execution>
						<id>minify-js</id>
						<phase>generate-resources</phase>
						<configuration>
							<skipMinify>false</skipMinify>
							<skipMerge>true</skipMerge>
							<sourceDir>externs</sourceDir>
							<targetDir>externs</targetDir>
							<outputFilename>#{filename}</outputFilename>
							<includes>
								<include>*.js</include>
							</includes>
						</configuration>
						<goals>
							<goal>minify</goal>
						</goals>
					</execution>
					<!-- Custom JavaScript for this portal, ES6 modules -->
					<execution>
						<id>minify-custom</id>
						<phase>generate-resources</phase>
						<configuration>
							<skipMinify>false</skipMinify>
							<skipMerge>false</skipMerge>
							<sourceDir>test</sourceDir>
							<targetDir>test</targetDir>
							<outputFilename>test.js</outputFilename>
							<includes>
								<include>**/*.js</include>
							</includes>
							<closureAssumeFunctionWrapper>true</closureAssumeFunctionWrapper>
							<closureOutputWrapper>(function(){%output%}).call(this);</closureOutputWrapper>
							<closureModuleResolution>NODE</closureModuleResolution>
							<closureDependencyMode>PRUNE</closureDependencyMode>
							<closureDependencyEntryPoints>
								<closureDependencyEntryPoint>file:index.js</closureDependencyEntryPoint>
							</closureDependencyEntryPoints>
						</configuration>
						<goals>
							<goal>minify</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

and

	<profiles>
		<profile>
			<id>fc-dev</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.github.blutorange</groupId>
						<artifactId>closure-compiler-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>minify-custom</id>
								<phase>generate-resources</phase>
								<configuration>
									<closureEmitUseStrict>false</closureEmitUseStrict>
									<closureForceInjectLibs>
										<closureForceInjectLib>base</closureForceInjectLib>
										<closureForceInjectLib>es6_runtime</closureForceInjectLib>
									</closureForceInjectLibs>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>m2e</id>
			<activation>
				<property>
					<name>m2e.version</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>com.github.blutorange</groupId>
						<artifactId>closure-compiler-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>minify-custom</id>
								<phase>generate-resources</phase>
								<configuration>
									<closureEmitUseStrict>false</closureEmitUseStrict>
									<closureForceInjectLibs>
										<closureForceInjectLib>base</closureForceInjectLib>
										<closureForceInjectLib>es6_runtime</closureForceInjectLib>
									</closureForceInjectLibs>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

JavaScript Source map generated by Closure compiler can have multiple links to the source files

Issue by i045053
Friday Apr 17, 2015 at 07:45 GMT
Originally opened as samaxes#97


JavaScript Source map generated by Closure compiler now can have links to each source file instead of only one link to the merged sources file. This may be
useful when debugging many JavaScript source files.
This is configured with the option closureMapToOriginalSourceFiles = true


i045053 included the following code: https://github.com/samaxes/minify-maven-plugin/pull/97/commits

gzip feature request

Issue by azerafati
Saturday Feb 21, 2015 at 09:55 GMT
Originally opened as samaxes#90


coming here from using Yui compressor plugin, I'm enjoying everything. But I miss the ability to create a gzipped version of my compressed files beside them
in YUI there is the option
true

this feature would be really appreciated, if it could also gzip files based on a filter so that we could gzip files of closure and yui and also already minified files which we excluded in configurations.

Stream closed

Happens only during m2e incremental build (WIndows)

java.io.IOException: Stream Closed
	at java.io.FileOutputStream.writeBytes(Native Method)
	at java.io.FileOutputStream.write(Unknown Source)
	at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
	at java.io.BufferedOutputStream.flush(Unknown Source)
	at java.io.FilterOutputStream.close(Unknown Source)
	at org.eclipse.m2e.core.internal.builder.plexusbuildapi.ChangedFileOutputStream.close(ChangedFileOutputStream.java:65)
	at com.github.blutorange.maven.plugin.closurecompiler.plugin.ProcessJSFilesTask.minify(ProcessJSFilesTask.java:144)
	at com.github.blutorange.maven.plugin.closurecompiler.plugin.ProcessFilesTask.processFiles(ProcessFilesTask.java:245)
	at com.github.blutorange.maven.plugin.closurecompiler.plugin.ProcessFilesTask.call(ProcessFilesTask.java:190)
	at com.github.blutorange.maven.plugin.closurecompiler.plugin.MinifyMojo.execute(MinifyMojo.java:652)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1360)
	at org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:52)
	at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:172)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1$1.call(MavenBuilder.java:115)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:105)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:795)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:216)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:259)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:312)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:315)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:367)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:388)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:142)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:232)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)

Stream closed error occurs when m2e and skipMinify are on

eclipse error message in pom.xml

Detailed error messages are as follows:


org.apache.maven.plugin.MojoExecutionException: Stream Closed
 at com.github.blutorange.maven.plugin.closurecompiler.plugin.MinifyMojo.execute(MinifyMojo.java:661)
 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
 at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331)
 at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362)
 at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1)
 at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
 at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
 at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1360)
 at org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:52)
 at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137)
 at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:172)
 at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)
 at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1$1.call(MavenBuilder.java:115)
 at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
 at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
 at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:105)
 at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
 at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
 at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
 at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86)
 at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
 at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
 at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) 
 at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
 at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
 at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
 at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
 at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
 at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
 at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
 at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:142)
 at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:232)
 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56) Caused by: java.io.IOException: Stream Closed
 at java.io.FileOutputStream.writeBytes(Native Method)
 at java.io.FileOutputStream.write(FileOutputStream.java:326)
 at java.io.BufferedOutputStream.write(BufferedOutputStream.java:122)
 at java.io.FilterOutputStream.write(FilterOutputStream.java:97)
 at org.eclipse.m2e.core.internal.builder.plexusbuildapi.ChangedFileOutputStream.writeIfNewOrChanged(ChangedFileOutputStream.java:101)
 at org.eclipse.m2e.core.internal.builder.plexusbuildapi.ChangedFileOutputStream.close(ChangedFileOutputStream.java:63)
 at com.github.blutorange.maven.plugin.closurecompiler.plugin.ProcessFilesTask.merge(ProcessFilesTask.java:366)
 at com.github.blutorange.maven.plugin.closurecompiler.plugin.ProcessFilesTask.processFiles(ProcessFilesTask.java:248)
 at com.github.blutorange.maven.plugin.closurecompiler.plugin.ProcessFilesTask.call(ProcessFilesTask.java:190)
 at com.github.blutorange.maven.plugin.closurecompiler.plugin.MinifyMojo.execute(MinifyMojo.java:655) ... 32 more 

This is my pom.xml setting.

<build>
	<finalName>test</finalName>
	<pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.eclipse.m2e</groupId>
				<artifactId>lifecycle-mapping</artifactId>
				<version>1.0.0</version>
				<configuration>
					<lifecycleMappingMetadata>
						<pluginExecutions>
							<pluginExecution>
								<pluginExecutionFilter>
									<groupId>com.github.blutorange</groupId>
									<artifactId>closure-compiler-maven-plugin</artifactId>
									<versionRange>[2.0.0,)</versionRange>
									<goals>
										<goal>minify</goal>
									</goals>
								</pluginExecutionFilter>
								<action>
									<execute>
										<runOnIncremental>true</runOnIncremental>
									</execute>
								</action>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	<plugins>
		<plugin>
			<groupId>com.github.blutorange</groupId>
			<artifactId>closure-compiler-maven-plugin</artifactId>
			<version>2.1.0</version>
			<configuration>
				<encoding>UTF-8</encoding>
			</configuration>
			<executions>
				<execution>
					<id>js-minify-custom</id>
					<configuration>
						<skipMinify>true</skipMinify>
						<closureLanguageIn>STABLE</closureLanguageIn>
						<closureLanguageOut>STABLE</closureLanguageOut>
						<closureCompilationLevel>BUNDLE</closureCompilationLevel>
						<outputFilename>skipMinify-${version}.js</outputFilename>
						<includes>
							<include>application/util/envUtils.js</include>
							<include>application/util/*.js</include>
							<include>application/**/*.js</include>
							<include>library/**/*.js</include>
						</includes>
					</configuration>
					<goals>
						<goal>minify</goal>
					</goals>
				</execution>
			</executions>
		</plugin>
	</plugins>
	<!-- .... -->
</build>

Closure Dependency Sorting Doesn't Work

Issue by buggtb
Saturday Nov 15, 2014 at 22:01 GMT
Originally opened as samaxes#80


I'm new to all this closure stuff, but from what I can tell the dependency sorting doesn't work(for me at least)

a) because its missing options.setManageClosureDependencies(true); (maybe)
b) because its trying to sort on an already merged file.

Tom

CSS files included out of order

Issue by garretwilson
Monday Sep 03, 2018 at 17:21 GMT
Originally opened as samaxes#162


I'm trying to merge CSS files together, and the plugin isn't respecting the order.

<cssSourceIncludes>
  <cssSourceInclude>stuff.min.css</cssSourceInclude>
  <cssSourceInclude>license.css</cssSourceInclude>
  <cssSourceInclude>foo.css</cssSourceInclude>
  <cssSourceInclude>bar.css</cssSourceInclude>
</cssSourceIncludes>
<cssFinalFile>foobar.css</cssFinalFile>

The file license.css gets placed somewhere toward the end of the merged file.

Note that I even have minification turned off!

Target directory not relative to source file directory

I was using samaxes/minify-maven-plugin and I just upgraded to this plugin. After that I found a major mismatch in the ouptput directory location.

I have js files in multiple input folders

for eg:
src\main\resources\META-INF\resources\js\f1\file1.js
src\main\resources\META-INF\resources\js\f1\file2.js
src\main\resources\META-INF\resources\js\f2\file3.js
src\main\resources\META-INF\resources\scripts\file4.js

Using samaxes/minify-maven-plugin I used to configure like this

<webappSourceDir>${basedir}/src/main/resources/META-INF</webappSourceDir>
<webappTargetDir>${project.build.outputDirectory}/META-INF</webappTargetDir>
<jsSourceDir>resources</jsSourceDir>
<jsTargetDir>resources</jsTargetDir>
<jsSourceIncludes>
	<jsSourceInclude>js/**/*.js</jsSourceInclude>
        <jsSourceInclude>scripts/*.js</jsSourceInclude>
</jsSourceIncludes>

The minified files ouput for this used to be:
src\main\resources\META-INF\resources\js\f1\file1.min.js
src\main\resources\META-INF\resources\js\f1\file2.min.js
src\main\resources\META-INF\resources\js\f2\file3.min.js
src\main\resources\META-INF\resources\scripts\file4.min.js
the target directory was same as the source directory.

But with the current plugin, for the configuration

<baseSourceDir>${basedir}/src/main/resources/META-INF</baseSourceDir>
<baseTargetDir>${project.build.outputDirectory}/META-INF</baseTargetDir>
<sourceDir>resources</sourceDir>
<targetDir>resources</targetDir>
<includes>
	<include>js/**/*.js</include>
	<include>scripts/*.js</include>
</includes>

the output is:
src\main\resources\META-INF\resources\file1.min.js
src\main\resources\META-INF\resources\file2.min.js
src\main\resources\META-INF\resources\file3.min.js
src\main\resources\META-INF\resources\file4.min.js

All output is coming to the targetDir location without considering the actual source path of the js file. How to achieve the older way of output.

Relative paths in CSS and Maven minification?

Issue by Hemanshu1belani
Wednesday Apr 19, 2017 at 06:12 GMT
Originally opened as samaxes#143


The problem
I have a workflow setup where maven combines and minifies multiple css files into one single file for a production environment.

The problem I'm facing is that font and image paths are breaking after running minification, as they're still pointing towards their existing relative file paths.

As an example:

Within static/homepage/startup/common-files/css/icon-font.css I have the following CSS rule:

@font-face{font-family:Flat-UI-Icons;src:url(../fonts/Startup-Icons.eot);
In my pom, I specify that I want the output of my minified css file to be style.min.css located at static/css/custom/homepage/. The problem with this is that the filepath changes, resulting in all font and image dependencies to no longer be found and return a 404 status in the browser.

eclipse incremental build support

Issue by belerweb
Saturday Jul 12, 2014 at 09:29 GMT
Originally opened as samaxes#61


I want eclipse execute minify plugin auto & incremental. So I add following config:

<pluginExecution>
    <pluginExecutionFilter>
        <groupId>com.samaxes.maven</groupId>
        <artifactId>minify-maven-plugin</artifactId>
        <versionRange>[1.7.2,)</versionRange>
        <goals>
            <goal>minify</goal>
        </goals>
    </pluginExecutionFilter>
    <action>
        <execute>
            <runOnIncremental>true</runOnIncremental>
        </execute>
    </action>
</pluginExecution>

It works, but when I save a file, even not a .js or .css file, then all minify execute again(It takes a long time. During the time, eclipse always show "Build workspace (xx%)").

So I want minify-maven-plugin support incremental build. If a files are not changed and the min files exist, then skip the excution.

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.

How do I prepend license or other header?

Issue by garretwilson
Monday Sep 03, 2018 at 02:41 GMT
Originally opened as samaxes#160


I figured out how to configure the plugin to minify a series of CSS files into individual *.min.css files.

I need each output minified file to contain a comment at the top with copyright/license information. How can I do that?

Closure: source map to multiple JavaScript files

Issue by i045053
Friday Apr 17, 2015 at 08:42 GMT
Originally opened as samaxes#98


Hello,
I have implemented a new feature (enhancement) as requested by my boss.
I needed many links in the source map to the original JavaScript files before they were merged and minified. Now there is one link generated to the merged file. But we needed many links to the original sources because we have some pages with many javascript files.
The CLOSURE compiler supports this feature already, but you have to invoke it with an array of all the source files.
I have implemented this and pushed my changes to a fork. I have added a new boolean configuration property
closureMapToOriginalSourceFiles
in the pom.xml
that works along with the existing config properties
jsEngine CLOSURE
and
closureCreateSourceMap true

Please review my changes and merge. Comments and questions are welcome.

I think my changes are backward-compatible over the existing minify configurations.

I also need a similar option for the CSS compression, but YUI compressor does not support source maps, so I am looking for another CSS compressor for that.

Thanks,
Svetlin

StackOverflow Error.

Issue by dwjohnston
Wednesday Jul 12, 2017 at 01:37 GMT
Originally opened as samaxes#147


[ERROR] Failed to execute goal com.samaxes.maven:minify-maven-plugin:1.7.4:minify (minify-css) on project realme-common-assets: java.lang.StackOverflowError -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.samaxes.maven:minify-maven-plugin:1.7.4:minify (minify-css) on project common-assets: java.lang.StackOverflowError
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: java.lang.StackOverflowError
        at com.samaxes.maven.minify.plugin.MinifyMojo.execute(MinifyMojo.java:475)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 20 more
Caused by: java.util.concurrent.ExecutionException: java.lang.StackOverflowError
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)
        at com.samaxes.maven.minify.plugin.MinifyMojo.execute(MinifyMojo.java:473)
        ... 22 more
Caused by: java.lang.StackOverflowError
        at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717)
        at java.util.regex.Pattern$BranchConn.match(Pattern.java:4568)
        at java.util.regex.Pattern$CharProperty.match(Pattern.java:3777)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4604)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
        at java.util.regex.Pattern$Loop.match(Pattern.java:4785)
... 

No skip option

Many Maven plugins have a skip config option to conditionally suppress execution. There appears to be nothing equivalent here (there are a couple of skipXXX options, but they do not suppress execution, only selected behaviors). Would you consider adding such an option?

Pretty print option in Closure Compiler

Issue by georgy7
Friday Sep 22, 2017 at 16:03 GMT
Originally opened as samaxes#150


Hello!

There is the option in Closure Compiler.

--formatting=pretty_print

screenshot_20170922_184257e

I was wondering if you may be able to add it to the plugin options.

With newlines in code it's much easier to find JS errors in production.

rewrite_polyfills parameter

Issue by OzoneGrif
Wednesday Sep 27, 2017 at 12:47 GMT
Originally opened as samaxes#151


Hello,

Is it possible to add "rewrite_polyfills=false" to the plugin?
I have a case where polyfills are conflicting and I need to handle them manually to avoid issues.
Plus, for a project with JS files loaded dynamically, it will be more optimized to have the Polyfill loaded only once.

Thanks!

breaks calculated values

Issue by garretwilson
Monday Sep 03, 2018 at 16:14 GMT
Originally opened as samaxes#161


My source file has this:

.foo {
  font-size: calc(0.5em + 1vw);
}

The plugin changes this to:

.foo{font-size:calc(0.5em+1vw)}

This is invalid and breaks the value.

This is is a blocker issue. The plugin is broken; I cannot use it.

Update to closure-compiler v20171023.

Issue by ghost
Saturday Nov 04, 2017 at 09:49 GMT
Originally opened as samaxes#155


Update to closure-compiler v20171023.

Update and fix compilation of MinifyMojo.java, by removing deprecated ECMASCRIPT6, and adding ECMASCRIPT_2015, ECMASCRIPT6_TYPED, ECMASCRIPT_2016, ECMASCRIPT_2017 and ECMASCRIPT_NEXT.

See: https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/CompilerOptions.java


ghost included the following code: https://github.com/samaxes/minify-maven-plugin/pull/155/commits

'closureCreateSourceMap' option does not work along with 'nosuffix' option

Issue by MrCaperwood
Friday Nov 21, 2014 at 13:19 GMT
Originally opened as samaxes#81


Problem: I use merging, minifying and javascript source maps functionality. When source map file is generated the attribute 'sources' references on temporary file created after merging all sources. As long as I use nosuffix=true temporary file is removed due to #32 fix in 1.7.1

Possible solution: Ideally solution would be to introduce another option 'removeMergedTmpFile' with default value "true" to separate this functionality from 'nosuffix' option. From my point of view, removing temporary file is not that related to 'nosuffix' functionality and it deserves separate option.

My config:

  <plugin>
    <groupId>com.samaxes.maven</groupId>
    <artifactId>minify-maven-plugin</artifactId>
    <version>1.7.4</version>
    <executions>
      <execution>
        <id>default-minify</id>
        <phase>process-resources</phase>
        <goals>
          <goal>minify</goal>
        </goals>
        <configuration>
          <closureCreateSourceMap>true</closureCreateSourceMap>
          <jsEngine>CLOSURE</jsEngine>
          <charset>utf-8</charset>
          <webappSourceDir>${project.build.directory}/v1/template/</webappSourceDir>
          <webappTargetDir>${project.build.directory}/v1/template/</webappTargetDir>
          <cssSourceDir>css/</cssSourceDir>
          <cssSourceIncludes>
            <cssSourceInclude>style.css</cssSourceInclude>
          </cssSourceIncludes>
          <cssFinalFile>all-style-${timestamp}.css</cssFinalFile>
          <jsSourceDir>js/</jsSourceDir>
          <jsSourceFiles>
            <jsSourceFile>jquery-1.7.2.min.js</jsSourceFile>
            <jsSourceFile>jquery.jqpagination.min.js</jsSourceFile>
            <jsSourceFile>jquery.validate.js</jsSourceFile>
            <jsSourceFile>layout.js</jsSourceFile>             
            <jsSourceFile>config.js</jsSourceFile>            
            <jsSourceFile>store.js</jsSourceFile>
          </jsSourceFiles>
          <jsFinalFile>script-${timestamp}.js</jsFinalFile>
          <nosuffix>true</nosuffix>
        </configuration>
      </execution>
    </executions>
  </plugin>

cssSourceExcludes ignored

Issue by tjahelka
Monday Mar 23, 2015 at 18:33 GMT
Originally opened as samaxes#94


Using version 1.7.4. We have a non-standard product structure. Our root node where the pom is, is also the root for our source code. We have a "shared" common css/ directory at the top level and then some small css files imbedded in the src code structure. We also have some 3rd party libraries we use which are copied into js/js-lib as part of the maven build. We do not want to minify anything in the js/js-lib directory.

My pom file has:

                <plugin>
                    <groupId>com.samaxes.maven</groupId>
                    <artifactId>minify-maven-plugin</artifactId>
                    <version>1.7.4</version>
                    <executions>
                        <execution>
                            <id>minify</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>minify</goal>
                            </goals>
                            <configuration>
                                <charset>utf-8</charset>
                                <jsEngine>CLOSURE</jsEngine>
                                <skipMerge>true</skipMerge>
                                <nosuffix>true</nosuffix>
                                <closureLanguage>ECMASCRIPT5</closureLanguage>
                                <webappSourceDir>${project.basedir}</webappSourceDir>
                                <webappTargetDir>${project.build.directory}</webappTargetDir>
                                <cssSourceDir>.</cssSourceDir>
                                <cssTargetDir>/optimized/css</cssTargetDir>
                                <cssSourceIncludes>
                                    <cssSourceInclude>**/*.css</cssSourceInclude>
                                </cssSourceIncludes>
                                <cssSourceExcludes>
                                    <cssSourceExclude>js/js-lib/**.css<cssSourceExclude>
                               </cssSourceExcludes>
                                <jsSourceDir>target/classes</jsSourceDir>
                                <jsTargetDir>/optimized/js</jsTargetDir>
                                <jsSourceIncludes>
                                    <jsSourceInclude>**/*.js</jsSourceInclude>
                                </jsSourceIncludes>
                                <jsSourceExcludes>
                                    <jsSourceExclude>js/js-lib/**.js</jsSourceExclude>
                                </jsSourceExcludes>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

When I run with this pom I get 2 messages.

No valid CSS
No valid Javascript

If I remove the excludes, it finds all CSS and .js files including those in the js/js-lib.

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.