5
4
3

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

  1. Edward Webb

    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.

  2. Viðar Svansson [Tempo]

    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.

CommentAdd your comment...

4 answers

  1.  
    9
    8
    7

    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>

    1. Igor Sereda

      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

    2. Jamie Echlin

      doesn't work either!

      with extensions: false I get:

      Cannot find lifecycle mapping for packaging: 'atlassian-plugin'.

    3. Igor Sereda

      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

    4. Bob Swift

      <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.

    5. Edward Webb

      Hey alright! This worked for me on confluence!

    6. Kinto Soft

      +1 for the Igor's answer.

    7. Pascal Charbonneau

      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 :)

    CommentAdd your comment...
  2.  
    2
    1
    0

    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>

    1. Edward Webb

      Note, this did not work for me. The class throwing the error actually looks internal to AMP

    CommentAdd your comment...
  3.  
    1
    0
    -1

    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> 
    1. Jamie Echlin

      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.

    2. Jamie Echlin

      The odd thing is when I do help:effective-pom I'd expect to see where this being called from, but I don't.

    3. Edward Webb

      Didn't work for me either, but Igor's answer did (extention=true, compress=false)

    CommentAdd your comment...
  4.  
    1
    0
    -1
    1. Matt Doar [ServiceRocket]

      Actually that bug mentions a property atlassian.webresource.disable.minification
      which you might be able to pass into the Java compile plugin?

    2. Joseph Clark [Atlassian]

      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.

    3. Joseph Clark [Atlassian]

      I think that's the million dollar question!

    4. Joseph Clark [Atlassian]

      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.

    CommentAdd your comment...