NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
Marcin Kwapisz Posted via mailing list.
|
Posted: Tue Oct 06, 2009 12:00 pm Post subject: NetBeans and filtering sources in Maven |
|
|
Hi,
I have maven project with filtered sources. The following part of pom.xml comes from that project.
<build>
.....
<resources>
<resource>
<directory>src/main/java</directory>
<filtering>true</filtering>
<targetPath>${project.build.directory}/filtered-sources/java</targetPath>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<sourceDirectory>${project.build.directory}/filtered-sources/java</sourceDirectory>
</build>
When sourceDiectory is set, NetBeans does not display Source Packages in Projects view (${basedir}/src/main/java). I see Generated Sources instead, but there is no point in modifying sources presented in that part of the project tree.
How I can configure Netbeans or pom.xml to see Source Packages and have filtered sources? Any ideas?
Thanks in advance
--
Marcin Kwapisz
Division of Computer Networks
Technical Univeristy of Lodz, Poland |
|
| Back to top |
|
 |
mkleint Posted via mailing list.
|
Posted: Tue Oct 06, 2009 12:17 pm Post subject: NetBeans and filtering sources in Maven |
|
|
Marcin Kwapisz wrote:
| Quote: | Hi,
I have maven project with filtered sources. The following part of pom.xml comes from that project.
<build>
.....
<resources>
<resource>
<directory>src/main/java</directory>
<filtering>true</filtering>
<targetPath>${project.build.directory}/filtered-sources/java</targetPath>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<sourceDirectory>${project.build.directory}/filtered-sources/java</sourceDirectory>
</build>
When sourceDiectory is set, NetBeans does not display Source Packages in Projects view (${basedir}/src/main/java). I see Generated Sources instead, but there is no point in modifying sources presented in that part of the project tree.
How I can configure Netbeans or pom.xml to see Source Packages and have filtered sources? Any ideas?
Thanks in advance
|
filtering of java sources is not supported. the "Sources" packages are
not "src/main/java" but as you set in your pom.xml, it's
target/filtered-sources/java.. how is the project supposed to know the
location if the non-filtered sources? And how can we know what sort of
think you are filtering/injecting. The stuff at src/main/java might not
even be compilable by the IDE..
Milos
Milos |
|
| Back to top |
|
 |
Marcin Kwapisz Posted via mailing list.
|
Posted: Wed Oct 07, 2009 10:25 am Post subject: NetBeans and filtering sources in Maven |
|
|
Hi Milos,
Thank you for your answer. First of all I would like to tell you that maven integration in NB is very good now. In most cases it is far better than m2eclipse in Eclipse IDE.
| Quote: | filtering of java sources is not supported. the "Sources" packages are
not "src/main/java" but as you set in your pom.xml, it's
target/filtered-sources/java..
|
[Marcin Kwapisz]
Yes, I have found that NB automatically assumes <sourceDirectory> as Source Packages (Project Properties -> Sources -> Source Folder is set to <sourceDirectory>)
| Quote: | how is the project supposed to know the
location if the non-filtered sources? And how can we know what sort of
think you are filtering/injecting. The stuff at src/main/java might not
even be compilable by the IDE..
| [Marcin Kwapisz]
What I can say. Source files are ... source files. They may not compile because of filtering. I am sure that a developer is 100% aware of that fact.
I think the problem is not how the project should know the location of non-filtered sources. NB should know where they are, for example: let a developer change Project Properties -> Sources -> Source Folder. Maven knows where source files are and how to process them, and as I know NB simply calls mvn to clean/build/run/... a project.
Regards
Marcin |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|