NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

NetBeans and filtering sources in Maven

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
Marcin Kwapisz
Posted via mailing list.





PostPosted: Tue Oct 06, 2009 12:00 pm    Post subject: NetBeans and filtering sources in Maven Reply with 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
--
Marcin Kwapisz
Division of Computer Networks
Technical Univeristy of Lodz, Poland
Back to top
mkleint
Posted via mailing list.





PostPosted: Tue Oct 06, 2009 12:17 pm    Post subject: NetBeans and filtering sources in Maven Reply with quote

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.





PostPosted: Wed Oct 07, 2009 10:25 am    Post subject: NetBeans and filtering sources in Maven Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo