Note that there are some explanatory texts on larger screens.

plurals
  1. POEclipse Maven WTP plugin not refreshing resources when switching profile
    text
    copied!<p>I'm developing a web application using Eclipse Juno and Maven-WTP plugin. This application has a header image and I also have two Maven profiles. Those profiles permit changing the header image, because they point to a different directory, where the image is located. That's how they are configured:</p> <pre><code>&lt;profile&gt; &lt;id&gt;local&lt;/id&gt; &lt;properties&gt; &lt;imagen.cabecera.dir&gt;src/main/resources/styles/headers/example1&lt;/imagen.cabecera.dir&gt; &lt;/properties&gt; &lt;/profile&gt; &lt;profile&gt; &lt;id&gt;local2&lt;/id&gt; &lt;properties&gt; &lt;imagen.cabecera.dir&gt;src/main/resources/styles/headers/example2&lt;/imagen.cabecera.dir&gt; &lt;/properties&gt; &lt;/profile&gt; </code></pre> <p>The idea is when I change the active profile in my <em>.m2/settings.xml</em> to have the header file changed as well. The active profile is configured like that:</p> <pre><code>&lt;activeProfiles&gt; &lt;!--make the profile active all the time --&gt; &lt;activeProfile&gt;nexus&lt;/activeProfile&gt; &lt;activeProfile&gt;local&lt;/activeProfile&gt; &lt;/activeProfiles&gt; </code></pre> <p>If I change the active profile and do <code>mvn clean install</code> everything works like a charm in project's target directory. However, the problem comes with Maven-WTP plugin. This plugin is taking the file from <code>webapp/images</code> directory, and looks like when I change the active profile is not getting the new one. It seems the WTP plugin is not updating the file here, so I get the old one displayed in the browser, even I do a <code>clean install</code>. This is my <strong>pom.xml</strong> configuration:</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;copy-resources&lt;/id&gt; &lt;phase&gt;process-resources&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;copy-resources&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;outputDirectory&gt;${project.build.directory}&lt;/outputDirectory&gt; &lt;resources&gt; &lt;resource&gt; &lt;directory&gt;${imagen.cabecera.dir}&lt;/directory&gt; &lt;includes&gt; &lt;include&gt;cabecera.jpg&lt;/include&gt; &lt;/includes&gt; &lt;targetPath&gt;${project.build.directory}/header&lt;/targetPath&gt; &lt;/resource&gt; &lt;/resources&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;default-war&lt;/id&gt; &lt;configuration&gt; &lt;webResources&gt; &lt;resource&gt; &lt;directory&gt;${project.build.directory}/header&lt;/directory&gt; &lt;includes&gt; &lt;include&gt;cabecera.jpg&lt;/include&gt; &lt;/includes&gt; &lt;targetPath&gt;/images&lt;/targetPath&gt; &lt;/resource&gt; &lt;/webResources&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre> <p>Does anybody know about that?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload