Quantcast
Channel: JetBrains Developer Community : Thread List - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5661

Idea deleting contents of Maven resource target directory

$
0
0
I have pretty straightforward Maven project I imported into Idea.  Project structure is:

Project Root
├───src
│   └───main
│       ├───java
│       └───resources
└───webcontent
    ├───css
    ├───images
    └───js

I have Maven copy and filter any .js files I have in src/main/resource into webcontent/js with this resources element:
<resource>
     <filtering>true</filtering>
     <directory>src/main/resources</directory>
     <targetPath>../../webcontent/js</targetPath>
     <includes>
          <include>*.js</include>
     </includes>
</resource>
I got a big surprise when I executed Project|Rebuild Project off the menu and found that Idea had deleted the contents of the webcontent/js directory before copying/filtering the .js files from src/main/resources (there are many other .js files in webcontent/js that are not put there by resource filtering).
I can understand why Idea thought it needed to do this (though this is not how Maven behaves outside of IJ).  My question is how did it figure out the webcontent/js folder was in effect a 'generated-sources' directory?  Also, what is really happening when I do a Build|Rebuild Project.  I would assume it is the exact equivalent of 'mvn clean' followed by 'mvn compile' but this is not true because Maven would not delete the contents of the directory.  Just wondering where Idea leaves off and Maven begins in the whole build process...?

Any insight is appreciated.

Thanks

Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>