maven - How to deploy WAR using Netbeans 7.3.1 + JBoss AS7 -


this existing project builds , deploys fine using intellij + as7. want build , deploy using netbeans 7.3.1 created new maven project in netbeans, selecting "import project using maven pom.xml files" option. netbeans recognized modules , used maven build project successfully. nice.

webapp assembled in [931 msecs] building war: g:\patrac_netbeans\patrac-web\target\patrac-web-1.0.war 

next, started jboss using netbeans' services panel. next, clicked run project button, expecting deployment occur, netbeans rebuilt project again. , remembered configuring intellij build & deploy using target directory. don't see way in netbeans. so, how set deployment using netbeans?

update 8/20/2013:

the deployment of ejb- , war modules work. here's output when deploying ejb:

cd g:\patrac_netbeans\patrac-ejb; "java_home=c:\program files\java\jdk1.7.0_25" "\"g:\program files\netbeans 7.3.1\java\maven\bin\mvn.bat\"" -dnetbeans.deploy=true package

scanning projects...

building patrac ejb module 1.0

...

build success

total time: 8.251s

finished at: tue aug 20 14:33:38 edt 2013

final memory: 22m/364m

netbeans: deploying on jboss application server

profile mode: false debug mode: false force redeploy: true 

distributing g:\patrac_netbeans\patrac-ejb\target\patrac-ejb.jar [org.jboss.as.ee.deployment.spi.deploymentmanagertarget@45fbf23c]

deploying g:\patrac_netbeans\patrac-ejb\target\patrac-ejb.jar

however when attempt run whole application netbeans doesn't deploy:

cd g:\patrac_netbeans; "java_home=c:\program files\java\jdk1.7.0_25" "\"g:\program files\netbeans 7.3.1\java\maven\bin\mvn.bat\"" -dnetbeans.deploy=true package

scanning projects...

reactor build order:

patrac

patrac ejb module

patrac web module

building patrac 1.0-snapshot

...

building patrac ejb module 1.0

...

building patrac web module 1.0

...

[war:war]

packaging webapp

assembling webapp [patrac-web] in [g:\patrac_netbeans\patrac-web\target\patrac.war]

processing war project

copying webapp resources [g:\patrac_netbeans\patrac-web\src\main\webapp]

webapp assembled in [557 msecs]

building war: g:\patrac_netbeans\patrac-web\target\patrac-web-1.0.war

reactor summary:

patrac - physician assistant tracking ............. success [0.043s]

patrac ejb module ................................. success [8.100s]

patrac web module ................................. success [2.324s]

build success

total time: 10.882s

finished at: tue aug 20 14:17:34 edt 2013

final memory: 25m/366m

why in world netbeans not deploy? perhaps problem doesn't know assembled war located? looking @ output, runs maven g:\patrac_netbeans, root pom located. assembled war located in g:\patrac_netbeans\patrac-web\target\patrac.war.

update 8/21/2013:

fyi plugin config follows:

            <plugin>                 <groupid>org.jboss.as.plugins</groupid>                 <artifactid>jboss-as-maven-plugin</artifactid>                 <version>7.4.final</version>             </plugin> 

as @happymeal correctly pointed out (see comment, below), looking @ maven's output plugin not running. @james r. perkins realized there 2 plugins: jboss-maven-plugin , jboss-as-maven-plugin , because using latter plugin using wrong goal: jboss:deploy instead of jboss-as:deploy. correcting mistake , rerunning project in netbeans following error occurred:

caused by: java.io.filenotfoundexception: g:\patrac_netbeans\target\patrac-1.0-snapshot.maven-project (the system cannot find path specified) 

next, added configuration parameters solved problem:

            <plugin>                 <groupid>org.jboss.as.plugins</groupid>                 <artifactid>jboss-as-maven-plugin</artifactid>                 <version>7.4.final</version>                 <configuration>                     <force>true</force>                     <targetdir>g:\patrac_netbeans\patrac-web\target</targetdir>                     <filename>patrac-web-1.0.war</filename>                 </configuration>                                 </plugin> 

problem solved!

the default maven goal "run project" button in netbeans package. goal builds project not deploy app.

you can change by:

  1. right-clicking on project , go properties.
  2. under categories panel, select actions.
  3. select "run project" action , edit "execute goals" textbox (e.g. jboss:start).

note need jboss maven plugin.


Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -