Sources/Test Sources/Exclusions not retained on maven resync pom.xml

I think this question applies more broadly to many maven plugins where additional source folders are created (e.g. Scala).

I'm using maven projects with the gmaven plugin for groovy alongside plain java code. So my maven structure looks like:
--src
-


main
-


java
-


groovy
-


test
-


java
-


groovy
--target

I can manually tell IDEA to understand that both the groovy folders also need to be marked as sources/test sources respectively. The hassle comes when I need to change the pom.xml on any of my projects and IDEA needs to reimport the project to get the dependency change. The reimport drops my groovy source folder mappings which means I have to set them up again manually.

As a side note my exclusion of "target" always gets dropped on reimport, which is also a hassle. I wish there was an option to make the entire target folder excluded. I read some thread where this is not the case because generated sources may be created there.

All I want is that my folder choices are sticky across resyncs, maybe store them in the iml.

Edited by: George Coller on Jul 2, 2008 11:20 PM

2 comments
Comment actions Permalink

NOTE: This is a repost from another thread but it is the only solid workaround I've found.

My current workaround is to make sure I delete the generated sources folder after every maven build (inside IDEA or from the command line). This allows me to also compile with the IDEA built-in compiler and run unit tests, debug, etc within IDEA.

For my own sanity I created a small command-line script to do a maven 'install' then delete target/generated-sources.

Hopefully this workaround will help others

0
Comment actions Permalink

Hi, George,

Please try 8.0.1, I've improved groove sources resolution and fixed some problems.

Thanks,
Anton Makeev

0

Please sign in to leave a comment.