NetBeans Forums

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

One click to build and run with Maven

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



Joined: 10 May 2010
Posts: 6

PostPosted: Wed Apr 11, 2012 8:01 am    Post subject: One click to build and run with Maven Reply with quote

Hi,

First time Maven user here... is it possible to create multiple Maven projects that are built and executed in a single click, in NB 7.1, just as normal projects does?

My current setup is, I have one Maven aggregator project that has dependencies to one application and multiple library projects that need be compiled first. Right now, I need to manually build the aggregator and then run the actual application. (The library projects are not compiled even though they are referenced to by the application.)

Thanks,

Patrik
Back to top
Milos Kleint
Posted via mailing list.





PostPosted: Wed Apr 11, 2012 10:20 am    Post subject: One click to build and run with Maven Reply with quote

build with dependencies action is customizable in project properties
dialog, actions panel.
There you define what will be the reactor scope, then in other
actions, like Run/Debug project, you check the checkbox "build with
dependencies" and them when you execute Run, you get the BwD goals
run, followed by the run goals.

Milos

On Wed, Apr 11, 2012 at 9:39 AM, Patrik Olsson <address-removed> wrote:
Quote:
Hi,



First time Maven user here... is it possible to create multiple Maven
projects that are built and executed in a single click, in NB 7.1, just as
normal projects does?



My current setup is, I have one Maven aggregator project that has
dependencies to one application and multiple library projects that need be
compiled first. Right now, I need to manually build the aggregator and then
run the actual application. (The library projects are not compiled even
though they are referenced to by the application.)



Thanks,



Patrik

Back to top
terifan



Joined: 10 May 2010
Posts: 6

PostPosted: Wed Apr 11, 2012 3:01 pm    Post subject: One click to build and run with Maven Reply with quote

I'm checking the BwD checkbox but this has no effect. The run goal is replace by the BwD goal.

I should say that using the BwD by right clicking on the project doesn't work either. NB simply uses the existing jars...

Do I need to add "--project-list" or "--also-make" arguments somewhere? If so what will they contain?


/Patrik

-----Original Message-----
From: Milos Kleint [mailto:address-removed]
Sent: den 11 april 2012 11:59
To: address-removed
Subject: [nbusers] Re: One click to build and run with Maven

build with dependencies action is customizable in project properties
dialog, actions panel.
There you define what will be the reactor scope, then in other
actions, like Run/Debug project, you check the checkbox "build with
dependencies" and them when you execute Run, you get the BwD goals
run, followed by the run goals.

Milos

On Wed, Apr 11, 2012 at 9:39 AM, Patrik Olsson <address-removed> wrote:
Quote:
Hi,



First time Maven user here... is it possible to create multiple Maven
projects that are built and executed in a single click, in NB 7.1, just as
normal projects does?



My current setup is, I have one Maven aggregator project that has
dependencies to one application and multiple library projects that need be
compiled first. Right now, I need to manually build the aggregator and then
run the actual application. (The library projects are not compiled even
though they are referenced to by the application.)



Thanks,



Patrik


Back to top
terifan



Joined: 10 May 2010
Posts: 6

PostPosted: Fri Apr 13, 2012 2:13 pm    Post subject: One click to build and run with Maven Reply with quote

Hi,

for future references... not a question.

Solution to the problem of build multiple modules while using Maven while using the run command (F6). Two things need to be done:

1) in the application project, enter preferences page. In section "Actions" locate "Run project" and check "Build with dependencies".

2) in POM of the application project, include a parent declaration with a relativePath to the aggregator POM.

<parent>
<groupId>com.mycompany</groupId>
<artifactId>mavenagg</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../mavenagg/pom.xml</relativePath>
</parent>


/Patrik

-----Original Message-----
From: Patrik Olsson [mailto:address-removed]
Sent: den 11 april 2012 16:40
To: address-removed
Subject: [nbusers] Re: One click to build and run with Maven

I'm checking the BwD checkbox but this has no effect. The run goal is replace by the BwD goal.

I should say that using the BwD by right clicking on the project doesn't work either. NB simply uses the existing jars...

Do I need to add "--project-list" or "--also-make" arguments somewhere? If so what will they contain?


/Patrik

-----Original Message-----
From: Milos Kleint [mailto:address-removed]
Sent: den 11 april 2012 11:59
To: address-removed
Subject: [nbusers] Re: One click to build and run with Maven

build with dependencies action is customizable in project properties
dialog, actions panel.
There you define what will be the reactor scope, then in other
actions, like Run/Debug project, you check the checkbox "build with
dependencies" and them when you execute Run, you get the BwD goals
run, followed by the run goals.

Milos

On Wed, Apr 11, 2012 at 9:39 AM, Patrik Olsson <address-removed> wrote:
Quote:
Hi,



First time Maven user here... is it possible to create multiple Maven
projects that are built and executed in a single click, in NB 7.1, just as
normal projects does?



My current setup is, I have one Maven aggregator project that has
dependencies to one application and multiple library projects that need be
compiled first. Right now, I need to manually build the aggregator and then
run the actual application. (The library projects are not compiled even
though they are referenced to by the application.)



Thanks,



Patrik


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