November 11, 2016 at 5:46 am #503092
I want to make a war file to deploy the Angular2 project which is developed using Angular IDE by Webclipse.
How to figure this out?November 14, 2016 at 4:42 am #503312
Thanks for giving a try to Angular IDE! Good news is that we do have integrated support for JavaEE on our roadmap. However, even now, it’s just few steps to get your project deployable to Tomcat.
First install required facets to the project:
- Right click on the project in Project Explorer+ and choose “Properties” and than choose “Project Facets”
- From the facet list choose Java and Dynamic Web Module (any 3.x)
- Click “Further configuration available…” link below the list of facets
- On the “Java” page, select “src” folder and remove it (unless you want to make a hybrid project, though in this case setup is slightly more complicated) and click Next
- On the “Web Module”, change “Content directory:” to
distis the default output folder for
ng build. If you changed the default setting, enter appropriate name here) and press OK.
- Press OK to install facets.
Now, build the project and deploy to your server:
- Open Terminal+ View and select your project from the combo list of from Project Explorer+
- Type command
ng build --watchto build the project. This should populate
distfolder with contents.
--watchflag will keep the command running and rebuilding
distcontents always when a change is made to the source code. You should always ensure this command is running in the terminal before starting the server.
- You can now deploy your project to Tomcat or other JavaEE servers.
Let me know if this works for you!
P.S. If you have troubles running
ng build, please run command
npm install --save-dev firstname.lastname@example.org.November 24, 2016 at 7:33 am #504312
Thanks for your prompt response. Its working.November 24, 2016 at 8:02 am #504314
I am glad it works for you! Please let us know if you have any problems or suggestions for Angular IDE!
Piotr TomiakMay 11, 2017 at 9:39 pm #522509
I did exactly as you said above,but after deployed to tomcat ,I’m not sure how to access my app.
After I entered my url in browser “http://localhost:8080/MyProjectName”,it brougnt me to my index.html, but the error were “Failed to load http://localhost:8080/vendor.bundle.js” and all the other js, Could you help me find the problems? Thanks!
Sorry to bother you ,I have solved this problem by changing the <base href=”<%=basePath%>”>, then it can find my js!
- This reply was modified 2 years, 6 months ago by Yang Fan.
Attachments:You must be logged in to view attached files.May 14, 2017 at 11:51 pm #522738
Glad that you figured it out.
Please let us know if you see any other issues.