Java – IntelliJ and Maven source folder issues
I tried to create a simple java webapp using IntelliJ (v11.1.3) and integrate it with a simple Maven POM file to download vaadin jar
This is my POM file:
<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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.a.maven.project</groupId> <artifactId>MavenProject</artifactId> <version>0.1</version> <packaging>war</packaging> <dependencies> <dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin</artifactId> <version>6.8.2</version> </dependency> </project>
I check this item from version control to set it up in IntelliJ However, IntelliJ does not seem to recognize that the "SRC" folder is a sources folder I can manually set it as the sources folder in the project settings, which is a small worry, but not a big one However, whenever I change the POM file, IntelliJ "forgets" that this is the source folder, and then all my java files get red circles around it Does anyone have any ideas that may lead to this? I've tried everything to solve this problem, including specifying the source folder in my POM file, but it doesn't seem to have any effect
Thank you in advance,
Eric
Solution
IntelliJ idea follows Maven conventions and takes auto configuration / SRC / main / Java as the source root directory
If you use a non-standard directory of the source, check the idea Maven FAQ for a workaround:
<sourceDirectory>...</sourceDirectory> will be added as Source folder