Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Thursday, September 17, 2020

How to Create a WAR file from a Spring Boot Project using Spring Tool Suite (STS)

 From this article, I  try to explain how to create a war file output as your spring boot project output through  the STS. I express this according to my practice and this may be differ with another person.

Follow the below mentioned steps.

01.The main application class should be extended to the SpringBootServletInitializer.

Example:

@SpringBootApplication
public class RippleReturnTransApplication extends SpringBootServletInitializer{

}

02. In your project's pom.xml file, spring-boot-maven-plugin should be included. 

            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>

03. In pm.xml file, mention the packaging type as 'war' in the correct place

    <groupId>hggg</groupId>
    <artifactId>Rdddddd</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>Rppppp</name>
    <description>App</description>

03. After that, update the maven project. Do: Right click on the project > maven > update project.

04. Now we have prepared the project for building. Now  Do: right click on the project > run as > maven install

Then STS takes few time for the execution. Then it will create the war file on a folder called 'target' inside the project. Now, This war file can be deployed on to a compatible web server.  

Happy Coding!


Tuesday, January 21, 2020

How to deploy a java web application on WebSphere Web Server

WebSphere is a popular enterprise web server which is owned by IBM. It serves for java based web applications. Lot of large scale organizations are using WebSphere.  Here, I am trying to explain the way of deploying a web application to the WebSphere web server. First of all we should create the project output file as .war/.jar. Old versions of WebSphere supports for classical file types such as war. So, let's imagine we have already created a war file (ex: MyApp.war) via the IDE  for the deployment.
There are few deployment methods. Here, my selected  method is deploying through  WebSphere integrated admin console. Let's go on.

Open the WebSphere integrated admin console with providing relevant admin credentials.



 Screen 1: Login Screen

After login to the system, You can see the main screen as follow.



Screen 2: Main Screen

In the navigation bar, expand  Applications > Application Types > WebSphere enterprise applications.



Screen 3: Navigation 

After clicking on "WebSphere enterprise applications" you can see the deployed Apps and it's status in right pane.



Screen 4: WebSphere deployed Apps

Here our target is to deploying a new war file (Web Application). To do this, You should click on the install button. Refer  the above Screen 4. After that, You should browse the target war file that you wish to deploy. After browsing the file path, go next. Refer the screen 5.



Screen 5: file browsing 


Then, System throws few screens  for asking some options as below. Provide the appropriate settings and go next step by step. Please refer Screen 6,7 and 8.




Screen 6





Screen 7



Screen 8

 After completing the action, you can see the Application in the list as screen 4.
Now You have completed the application deployment operation. Before Starting the Application you should restart the WebSphere server. After restarting, go to  "Applications > Application Types > WebSphere enterprise applications " and start the application.
Cheers!!!  :)