NetBeans Forums

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

Changing Maven 'Test' Binding

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
smozely



Joined: 06 Oct 2009
Posts: 29

PostPosted: Thu Apr 01, 2010 2:25 am    Post subject: Changing Maven 'Test' Binding Reply with quote

Hi all,

What I would like to do is be able to right-click on a file in a maven project and run a maven goal with a profile and pass in the class that has been clicked on ... i.e.

mvn verify -P test -Dtest=${className}

I've been following the instructions from this page
http://wiki.netbeans.org/MavenBestPractices

I first tried adding a new Custom action but this didn't work because custom goals seem to only be bindable to the Project level. Not an individual file.

So I thought I could override the "Test File" action, and this works fine .... but only the first time I run it the next time it breaks. I think it is because Netbeans treats test file in a special way.

Just wondering if anyone could offer advice on how I could achieve my goals (pun)

- Steve
Back to top
Milos Kleint
Posted via mailing list.





PostPosted: Thu Apr 01, 2010 1:11 pm    Post subject: Changing Maven 'Test' Binding Reply with quote

On Thu, Apr 1, 2010 at 4:25 AM, smozely <address-removed ([email]address-removed[/email])> wrote:
Quote:
Hi all,

What I would like to do is be able to right-click on a file in a maven project and run a maven goal with a profile and pass in the class that has been clicked on ... i.e.

mvn verify -P test -Dtest=${className}

I've been following the instructions from this page
http://wiki.netbeans.org/MavenBestPractices

I first tried adding a new Custom action but this didn't work because custom goals seem to only be bindable to the Project level. Not an individual file.


nice enhancement I guess.. it could generally work on the maven side, there's just no UI now to show goal execution action on a file (except for the generic ones)
 
Quote:

So I thought I could override the "Test File" action, and this works fine .... but only the first time I run it the next time it breaks. I think it is because Netbeans treats test file in a special way.



probably related to "compile on save" combo.. when you disable it, you should be getting exactly what you want.


Milos


 
Quote:
Just wondering if anyone could offer advice on how I could achieve my goals (pun)




Back to top
smozely



Joined: 06 Oct 2009
Posts: 29

PostPosted: Mon Apr 05, 2010 9:40 pm    Post subject: Reply with quote

Hi Milos,

Thanks very much for the response. It now works as we want it to.

-Steve
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