Saturday 12 November 2016

Create a war file out of JET project and Deploy the application to manged Weblogic server

To create a war file and deploy to the managed WebLogic  server, I have followed below mentioned steps.

  •      Created a JET application with yeoman generator and used basic template. Since we cannot run grunt build run command for the application created using QuickStartTemplate.
  • .       Copy the source files(JS,CSS, and Index.html ) from your actual JET application to the basic template application.
  • .       Build the above application using grunt. It gives release/web folder(minified version of your app).
  • .       Copy the generated web/release folder content to web project created using JDEV and create a war file out of this.


I have created jet application using yeoman generator with basic template instead of using NetBeans IDE and QuickStartBasicTemplate

Reason: As John Explained in the OTN forum, The QuickStartBasic template is an older template that was written before JET v2.1.0 was released.  It is not based on Grunt or Bower and does not contain any commands or tasks for working with Grunt and Bower.  There is nothing to "build".

The newer Starter Template based applications which came out with Oracle JET v2.1.0 and are used via the JET command line tooling have the ability to work with both Web and Hybrid platforms.  They must be "built" to provide the correct look, feel, and functionality for each platform. Thus they have Grunt tasks provided as part of the template.

You can not use QuickStartBasic to do all of the Hybrid and "dev"/"release" types of functionality. If you wanted to add Grunt to this template, you would have to change the structure of the application as well so that there was something to "build"

The YoOracleJET plugin is a third party plugin that helps simplify the use of Yeoman CLI commands from within NetBeans. It really just runs the command line interface behind the scenes.  It tells you which commands it's running in the descriptions of each template.


yo oraclejet JETWebApp --template=basic

Once it is successfully created the app, then you should see the below message





Open the same project in NetBeans IDE

Replace CSS, JS and index.html files from your JET project( maybe you have used QuickStartBasic template to create the JET app )




Run the app locally




Now we need to run grunt build command   from the root directory of your app.
 grunt build:release

before running grunt build:release the folder structure is as follows

run the grunt build command.



After  running grunt build:release command, it creates a new folder called “web”. This folder contains minified version of your app. As shown below



To deploy to Integrated web logic server, you do not need to create a war file, just create WEB-INF folder and empty web.xml inside the web folder and you able to deploy


Since we do not have  the option to created war file directly, I have used JDeveloper and created a web project.
Now in JDeveloper, I have created a custom application (File -> New -> Custom Application)
Inside this custom application created a web project. As you see, now I have WEB-INF folder and deployment descriptor file web.xml



Now I copy the contents of my web folder
Under web content in the web project created using JDEV  (within public_html folder)


After copying , files in my the web project are looks like as shown below

Now by right clicking on the project folder, you get the option to create the war file. Create the war file and deploy  the war file on the server.

Hope this helps!




No comments:

Post a Comment