Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Changes on resource files (js, css) require QuickReload to reinstall plugin and clear browser cache

Vladimir Vasic
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 23, 2016

When I make changes in resource files like javascript files, I have to:

atlas-mvn package -DskipTests

then I have to clear browser cache (and login again) in order to see changes on some page which changed javascript relates to.

Please note in my pom.xml that I've added resource directories in JVM arguments:

-Dplugin.resource.directories=/src/main/resources

I've read in couple of answers (here, and here) that using QuickReload does not require to reinstall plugin in order for resource changes to appear/to take effect (just need to reload page).

Please provide sample pom.xml which will enable this resources changes to take effect without reinstalling plugin and clearing browser cache.

Here is my pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>acme.org</groupId>
    <artifactId>acme-project</artifactId>
    <version>1.0-SNAPSHOT</version>
    <organization>
        <name>Acme</name>
    </organization>


    <name>Acme JIRA plugin</name>
    <description>Some description.</description>
    <packaging>atlassian-plugin</packaging>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-tests</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <version>1.1.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>

                    <jvmArgs>-Xmx2048m -Datlassian.plugins.enable.wait=1000 -Datlassian.mail.senddisabled=false -Datlassian.mail.fetchdisabled=false -Dplugin.resource.directories=/src/main/resources</jvmArgs>
                    <productVersion>${jira.version}</productVersion>
                    <productDataVersion>${jira.version}</productDataVersion>
                    <allowGoogleTracking>false</allowGoogleTracking>
                    <log4jProperties>src/aps/log4j.properties</log4jProperties>

                    <!-- make AMPS faster -->
                    <enableFastdev>false</enableFastdev>
                    <enableDevToolbox>false</enableDevToolbox>
                    <enablePde>false</enablePde>
                    <skipRestDocGeneration>true</skipRestDocGeneration>
                    <skipManifestValidation>true</skipManifestValidation>
                    <extractDependencies>false</extractDependencies>
                    <skipManifestValidation>true</skipManifestValidation>
                    <enableQuickReload>true</enableQuickReload>
                    <pluginArtifact>
                        <groupId>com.atlassian.labs.plugins</groupId>
                        <artifactId>quickreload</artifactId>
                        <version>${quick.reload.version}</version>
                    </pluginArtifact>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.17</version>
                <configuration>
                    <reportsDirectory>${surefire.and.failsafe.report.dir}</reportsDirectory>
                    <properties>
                        <property>
                            <name>junit</name>
                            <value>true</value>
                        </property>
                    </properties>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.17</version>
                <configuration>
                    <reportsDirectory>${surefire.and.failsafe.report.dir}</reportsDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <properties>
        <jira.version>6.4.13</jira.version>
        <amps.version>6.2.1</amps.version>
        <quick.reload.version>1.4.4</quick.reload.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <testkit.version>5.2.26</testkit.version>
        <surefire.and.failsafe.report.dir>target/surefire-reports</surefire.and.failsafe.report.dir>
       <log4j.properties.location>src/aps/log4j.properties</log4j.properties.location>
        <skipITs>true</skipITs>
    </properties>
</project>

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Vladimir Vasic
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2016

Actually here is how it should be done. I've picked it up from AtlasCamp two days ago.

First of all, there is no QuickReload version 1.4.4 and reason why it worked for me, though not entirely correctly,  is that there is QuickReload 1.24.1 version in AMPS already packaged (if you check log).

So, correct version of QuickReload is 1.30.2. Other thing is that <pluginArtifact> should be inside <pluginArtifacts> tag, like this:

&lt;pluginArtifacts&gt;
    &lt;pluginArtifact&gt;
        &lt;groupId&gt;com.atlassian.labs.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;quickreload&lt;/artifactId&gt;
        &lt;version&gt;${quick.reload.version}&lt;/version&gt;
    &lt;/pluginArtifact&gt;
&lt;/pluginArtifacts&gt;

Reason why QuickReload 1.24.1 didn't work correctly with resources (js, css, ...) is because it was batching them for faster loading but it didn't take latest changes in files and it cached them. So work around could be to disable cache in your browser.

With QuickReload 1.30.2 it is fixed, so all you need to do after some, let's say js file change is to reload the page in browser and bam it is working!

1 vote
David Horvath May 26, 2016

Hello,

You need to turn on dev mode for JS and CSS reloading. (Just press the B key in the browser)

Saurabh Gupta April 26, 2018

This may be one of the reasons for package reload not working(In my case above resolved it).  I don't understand what Vladminir is writing. Also for the plugin where you ran atlas-run || atlas-debug command. You don't need to explicitly specify the path of resources for that plugin. Specifying path is for external plugins.

TAGS
AUG Leaders

Atlassian Community Events