m2e not picking up generated web resources
See original GitHub issueI’ve been trying for a few days to get frontend-maven-plugin integrated to our web application build. I quickly got the pom.xml working to process a LESS file into CSS as part of building a WAR.
I added the plugin configured this way:
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.0</version>
<installDirectory>target</installDirectory>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v6.3.0</nodeVersion>
<npmVersion>2.15.8</npmVersion>
</configuration>
</execution>
<execution>
<id>install js packages</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
<execution>
<id>compile less</id>
<goals>
<goal>gulp</goal>
</goals>
<configuration>
<srcdir>${basedir}/src/main/less</srcdir>
<outputdir>${project.build.directory}/generated-web-resources</outputdir>
<arguments>less</arguments>
</configuration>
</execution>
</executions>
</plugin>
I modified the maven-war-plugin to define additional web resources:
<webResources combine.children="append">
<resource>
<directory>${project.build.directory}/generated-web-resources</directory>
</resource>
</webResources>
I’m struggling to get m2e integration to work; when I change the source LESS file, a build is triggered in Eclipse and the resulting CSS file gets written to ./target/generated-web-resources
as expected. At this point, I expect the m2e integration to copy the file into the ./target/m2e-wtp/web-resources
path, but it takes no action.
If I modify the generated CSS file and save, m2e picks up the change and copies the file to its location in ./target/m2e-wtp/web-resources
.
Is there something I need to do in order to have m2e to pick up that there are newly generated files which it should be copying into its resources?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:9 (2 by maintainers)
@mriehema how does your comment address the problem. I’ve got the same issue as the others above. m2e-wtp picks up manual changes to the generated resources but does not pick up the files generated and refreshed by the frontend plugin
You have to declare the directory as a webResource:
Stephan