After creating a library directory, the next step is to actually share the project's library.
When projects become mature enough, or just for testing purposes, the developer can package the entire project into compressed Java Archive Files (JAR). These compressed files might be enterprise (EAR) or web (WAR) format, or simply JARs.
For this recipe, we will be using the previously created project and creating the WAR file from it.
If no Project is currently available at the Projects tab, follow the Creating libraries recipe to ensure that this recipe will work.
Or
build.xml
.NetBeans uses Apache Ant as the automated building system of choice.
This script is incorporated into NetBeans menus while on the Projects panel, as seen by the build menu. By clicking on build, NetBeans will call the Ant script and initiate the process of bundling all the necessary files of this project into the WAR file.
The second step-by-step is given as an example on how to access the dist target through the Files panel.
Unsure which way to execute? And why is it good to have a separate build.xml
generated by NetBeans?
The second method, though longer, is very complete in the sense that other targets can be attained, in case the dist is not necessarily what we want.
The advantage with NetBeans build.xml
is that it can be used outside the IDE as well; very useful if you are deploying the application in a machine that does not have access to a Graphical Interface. It also lets the project be packaged without the necessity of using NetBeans.
For example, sometimes the developer needs to connect remotely to some server that does not provide a graphical window manager to solve issues/bugs/introduce features. In this case, it is easy to make necessary changes, package the solution, and deploy to the application server.
18.224.59.50