uglify-maven-plugin adding exclude file list - maven

I am trying to implement uglifyjs-maven-plugin.
While using the configuration mentioned here, I am getting error like sourceDirectory is undefined or invalid.
Using the configuration like
<configuration>
<sourceDirectory>target/snapshot/javascript</sourceDirectory>
<outputDirectory>target/snapshot/javascript</outputDirectory>
</configuration>
its working fine. But how will I add exclude file list in the above configuration.
I have a js file of 900kb, when i am including that js file inside source directory, i am getting exception during maven build as " Exception in thread "main" java.lang.StackOverflowError". Can anyone help me out of this.

It looks like that while the documentation (and probably the current implementation) supports file exclusions, the version available in the repository (1.0) is older and supports only sourceDirectory.
I have not found any newer version published anywhere, so I guess the best thing we can do is compile the latest version of the plugin manually and see if it supports what the documentation says.

Related

Build/Run Elasticsearch Locally with plugins

(On Elasticsearch version 6.5.1)
How can I build/run Elasticsearch from source with local plugins?
I've tried the following command to install the plugins:
./distribution/build/cluster/run\ node0/elasticsear-6.5.1-SNAPSHOT/bin/elasticsearch-plugin install file:/<path_to_plugin_zip> and that says it successfully installed the plugin.
However, when I run elasticsearch via ./gradlew run --debug-jvm, it cleans out the contents of that directory before running ES.
The reason I installed the plugin into that particular directory is that I put a debugger in the PluginsService.java file, and saw that the Path pluginsDirectory parameter in the constructor was set to /Users/jreback/Desktop/elasticsearch/distribution/build/cluster/run node0/elasticsearch-6.5.1-SNAPSHOT/plugins.
So, how can I get my plugin installed on my local ES version and run ES such that the plugin code doesn't get removed as the process starts up? Many thanks in advance!
FWIW, I got this working with some manual code changes (there may be or likely is a more recommended way to do this, but this worked for me).
In my ES checkout, I made the following code change to server/src/main/java/org/elasticsearch/env/Environment.java:
replace this line: pluginsFile = homeFile.resolve("plugins"); with pluginsFile = Paths.get("<path to plugin directory");
(Also, you must import java.nio.file.Paths at the top of that file).
The directory structure for the directory you listed above should look like this:
- plugin parent directory (should whatever you put in the Environment.java file)
- plugin directory (name of the plugin)
- plugin-descriptor.properties file
- plugin jar file (generated from building the plugin in some prior step)
Then you should see that it loaded the plugin you've just added in the logs when you start up ES again.

Adding Maven Dependencies to Ant

I'm trying to implement adding maven dependencies to my ant build using this article. I beleive I have everything set up as indicated by the article but since it is not working I must be missing something. I am getting this error:
Could not load definitions from resource org/apache/maven/artifact/ant/antlib.xml. It could not be found.
My searches for this error seem to imply I an missing maven-ant-tasks-2.1.3.jar. However, it is in the path indicated by the classpath. Can someone help be debug this? TIA.
I found at least part of the problem. I had the wrong file name in the classpath. It was maven-ant-tasks.jar and it should have been maven-ant-tasks-2.1.3.jar.
Unfortunately I now have a different problem which I think implies a corrupt jar file.
Unable to obtain resource from /usr/build/lib/maven-ant-tasks-2.1.3.jar: java.util.zip.ZipException: error in opening zip file
Downloading the jar file again did not help.
Never mind. Apparently the Apache maven web site has a corrupt version. I downloaded it from the mvnrepository and that worked.

core nlp truecaseannotator not found

I just got started with CoreNLP version 3.6.0. I've downloaded this version from this website. Using the commandline pipeline, I've been able to perform the standard pipeline annotators but ran into a problem with the truecase annotator:
Here's a copy of the terminal output:
loadClassifier=edu/stanford/nlp/models/truecase/truecasing.fast.caseless.qn.ser.gz
mixedCaseMapFile=edu/stanford/nlp/models/truecase/MixDisambiguation.list
classBias=INIT_UPPER:-0.7,UPPER:-0.7,O:0
Exception in thread "main" edu.stanford.nlp.io.RuntimeIOException: java.io.IOException: Unable to open "edu/stanford/nlp/models/truecase/truecasing.fast.caseless.qn.ser.gz" as class path, filename or URL
at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifierNoExceptions(AbstractSequenceClassifier.java:1499)
at edu.stanford.nlp.pipeline.TrueCaseAnnotator.(TrueCaseAnnotator.java:58)
at edu.stanford.nlp.pipeline.AnnotatorImplementations.trueCase(AnnotatorImplementations.java:199)
at edu.stanford.nlp.pipeline.AnnotatorFactories$10.create(AnnotatorFactories.java:435)
at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:85)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:375)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:139)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:135)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.main(StanfordCoreNLP.java:1222)
Any ideas?
We tried to make the default models jar a bit smaller and decided to not include this model by default. But it is still contained in the English models jar which you can download from release history page.
After you downloaded the jar, make sure to put it in your classpath before you run CoreNLP. The English models jar should also contain everything in stanford-corenlp-3.6.0-models.jar, so you won't need both of them in your classpath.

Is SpringSource Tool Suite 2.6 Grails support broken?

I have recently updated my STS from 2.5.2 to 2.6. Since then, each grails project shows an error in the conf/spring/resources.groovy file reading: Description Resource Path Location Type
Internal compiler error: java.lang.VerifyError: (class: org/codehaus/jdt/groovy/internal/compiler/ast/JDTClassNode, method: initialize signature: ()V) Bad access to protected data at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.createClassNode(JDTResolver.java:461) resources.groovy /GrailsProject/grails-app/conf/spring line 0 Java Problem
The resources.groovy file is as good as empty (in default state), and if I delete it, the error is shown on the DataSource.groovy, so the file itself seems not to be the cause.The used groovy compiler version is 1.7.3.I have made a clean STS 2.6 install, installed the groovy and grails plugins and got the same error.What could be the problem? And is there a solution to this not resulting in downgrading to 2.5.2 again? Thank you
Take a look at your preferences Groovy -> Compiler. Are you by any chance accidentally using Groovy 1.6?
EDIT
That didn't solve the problem, but as described in http://forum.springframework.org/showthread.php?p=357361, upgrade to the latest dev build of Groovy-Eclipse as well as Grails Tooling and that should work.

How do I set where my grails plugins should be installed?

I saw the light and install the joda-time plugin for grails.
However, when I tried to commit my changes to source control I realised that grails had located the files in:
C:\Users\Steve\.grails\1.1.1\plugins
instead of somewhere under the project directory of:
f:\grails\projects\myproject
Yeah I'm using windows :-\
So now when someone pulls down my changes from source control they are missing all the joda-time plugin lovelyness and they are wanting to spank me :)
What should I be setting so that grails doesn't put anything under my user directory?
(It isn't installed as a global plugin - just as a project one - at least I think so, I ran "grails install-plugin joda-time" )
Many thanks in advance.
P.S. Currently listening to Plug In Baby by Muse....how coincidental :D
The plugin is listed in application.properties, so when someone gets your code Grails will install missing plugins the first time they run 'grails run-app' or other commands.
If you want to revert to 1.0.x behavior just create grails-app/conf/BuildConfig.groovy with the line
grails.project.plugins.dir='plugins'
and your plugins will be in with the rest of the project files.

Resources