Hi -
mvn package is falling over when trying to compress a utf-8 encoded file... what maven snippet do I need to specify the encoding?
Also it's attempting to compress already minified files resulting in them actually getting bigger - how can I disable the compressor altogether?
cheers, jamie
Community moderators have prevented the ability to post new answers.
Try this:
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-jira-plugin</artifactId>
<version>3.3.1</version>
<extensions>true</extensions>
<configuration>
<compressResources>false</compressResources>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-jira-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<plugin.resource.directories>${basedir}/target/classes</plugin.resource.directories>
<atlassian.dev.mode>false</atlassian.dev.mode>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
Put maven-jira-plugin version there to show the version known to work.
Also we have <extensions>true</extensions> under <plugin> - not sure if that's relevant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
doesn't work either!
with extensions: false I get:
Cannot find lifecycle mapping for packaging: 'atlassian-plugin'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm... I know for a fact that our plugin's resources don't go through minification during build (we use other minification tools).
I'm editing the answer to add more from our POM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<compressResources>false</compressResources> worked great! Nothing minimized which is what I need now. Thanks. That leaves the question about how to selectively stop it from handling files it shouldn't. It is not clear why the default is to minimize non-js or non-css files in the first place.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey alright! This worked for me on confluence!
<plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-confluence-plugin</artifactId> <version>${amps.version}</version> <extensions>true</extensions> <configuration> <productVersion>${confluence.version}</productVersion> <productDataVersion>${confluence.data.version}</productDataVersion> <compressResources>false</compressResources> </configuration> </plugin>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
+1 for the Igor's answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also a BIG +1 as I have been chasing this for days trying to work with CLI/pi to debug some Javascript. Works like a charm now :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do not forget to run "atlas-clean" to delete old minified javascript files before building a new package with "atlas-packages"
All of 3 options
<compressJs>false</compressJs>
<compressCss>false</compressCss>
<compressResources>false</compressResources>
are working for me now when pasted to configuration block as Igor Sereda mentioned.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The YUICompressor is called by Amps, the Atlassian maven plugin which compiles your jar. AMPS calls it with the current pom as a context, so you can configure it in your pom.xml. It has a <skip> configuration parameter, so this would probably be a good way to go:
<project> ... <build> ... <pluginManagement> <plugins> <plugin> <groupId>net.sf.alchim</groupId> <artifactId>yuicompressor-maven-plugin</artifactId>
<!-- The version is probably not necessary --> <version>0.7.1</version> <configuration> <skip>true</skip> </configuration> </plugin> </plugins> </pluginManagement> ... </build> </project>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Note, this did not work for me. The class throwing the error actually looks internal to AMP
[INFO] Trace org.mozilla.javascript.EvaluatorException: Compilation produced 3 syntax errors. at com.atlassian.maven.plugins.amps.util.minifier.YUIErrorReporter.runtimeError(YUIErrorReporter.java:35) at org.mozilla.javascript.Parser.parse(Parser.java:392) at org.mozilla.javascript.Parser.parse(Parser.java:337) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533) at com.atlassian.maven.plugins.amps.util.minifier.ResourcesMinifier.yuiJsCompile(ResourcesMinifier.java:156) at com.atlassian.maven.plugins.amps.util.minifier.ResourcesMinifier.processJs(ResourcesMinifier.java:98)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is somewhat old question, but I post my answer here for anyone struggling this issue with JIRA 7. For me worked setting compressResources to false in maven-amps-plugin, like so:
<plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-amps-plugin</artifactId> <extensions>true</extensions> <configuration> <compressResources>false</compressResources> </configuration> </plugin>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Duplicate answer. Vote for existing instead please.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Vidar, I answered your question on the AMPS JIRA issue: https://ecosystem.atlassian.net/browse/AMPS-796?focusedCommentId=100003&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-100003
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does anyone know why AMPS is producing these errors. We have developers with AMPS 4.1.x and they can't run atlas-package because of YUI errors but it works fine on AMPS 3.10-3.11.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Voting for this question and the issue Joseph linked to. Does anyone have _any_ work around to at least allow me to host some resource files with my plugin? The syntax warnings I get don't help me track down a cause I can fix.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could vote for https://jira.atlassian.com/browse/JRA-24964
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually that bug mentions a property atlassian.webresource.disable.minification
which you might be able to pass into the Java compile plugin?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
atlassian.webresource.disable.minification is a system property of the hosting application that determines whether or not the plugin framework looks for minified files before serving the requested resource.
Unfortunately it does not control whether or not the Plugin SDK actually generates the minified files in the first place.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Joseph: what does?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think that's the million dollar question!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This came up again internally, no-one I've asked knows how to do this. For posterity, I've created https://ecosystem.atlassian.net/browse/AMPS-796 in the hopes that we can find an answer eventually.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And eventually, the real answer. Thanks to Igor for finding this, and to Eddie for testing out and confirming: https://ecosystem.atlassian.net/browse/AMPS-796?focusedCommentId=96080&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-96080
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From https://www.adaptavist.com/display/~jmort/2011/02/09/Advanced+Atlassian+Plugin+SDK I'd try something like this:
<project> <properties> <atlassian.dev.mode>false</atlassian.dev.mode> <atlassian.webresource.disable.minification>true</atlassian.webresource.disable.minification> </properties>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hrm thanks, but that didn't work. The linked page leads me to believe that those are system properties passed to jira for when you do atlas-run - ie disable serving the minified files at runtime.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The odd thing is when I do help:effective-pom I'd expect to see where this being called from, but I don't.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Didn't work for me either, but Igor's answer did (extention=true, compress=false)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.