1
votes

I've been asked to migrate an older Ant-based web application. I'm building and trying to deploy using Eclipse Luna with JBoss Tools 3.0.1.Final. JBoss instance is EAP 6.3.0 (AS 7.1).

The build tool, like I said, is Ant. And when I run ant package, a valid WAR file is created at /target/foo.war

For some reason I'm having a heck of a time trying to explain to Eclipse and JBoss server that the foo.war file is what I want to deploy.

To this end I've:

  • Right-clicked on the project root and opened the Properties dialog.

  • Declared custom Ant builder for the project by going to Builders and adding an Ant builder and disabling the default Java builder.

Now Project -> Clean removes the target/ folder; Project -> Build results in a /target/foo.war file.

So far so good. At this point, I think all I need to do is declare that foo.war file as the Web Deployment Assembly? If I go to Web Deployment Assembly and click Add, then add the target/foo.war file, it tries to add it as a project library (i.e. WEB-INF/lib/foo.war). So clearly that's wrong.

I've also gone to the Server view, and tried numerous settings in the Deployment tab. The closest I've come to what I'm looking for is the Default Settings, but I haven't had any luck there, either.

(When I start JBoss via the JBoss Tools in Eclipse, then pull up the management console on port 9990, I can upload and deploy the WAR that way with no issues.)

I'm sure there's something completely obvious I'm missing. Could anyone help an IntelliJ user out? I have seen https://stackoverflow.com/a/4261178/3223711, but it seems to be missing the "last mile" in that the problem is not generating the WAR but in getting JBoss to actually pick it up and use it.

Thanks!

1
Right-click on the Project Explorer target/foo.war, select Mark Deployable. Then right-click on the foo.war file again and Run As... -> Run On Server... Choose the JBoss instance. If you go to the Servers view, you'll now see your WAR file under the JBoss instance as /<root>/target/foo.war Oh Eclipse, sigh.... - IanC

1 Answers

1
votes

Since you are not actually not configuring the project to be a war project by Eclipse knowledge you need to tell JBoss Tools that you wish to deploy the specific war file.

To do this right click on the target/foo.war and select 'Mark as Deployable' - this tell JBoss Tools this foo.war can be deployed meaning you can now drag it to a server or add it via Add/Remove on the server.