Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8044387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:12:50+00:00 2026-06-05T05:12:50+00:00

I am new to maven. So I have a project with pom.xml file. So

  • 0

I am new to maven. So I have a project with pom.xml file. So I ran that with maven and the build was successful. I have glassfish. Glassfish is already running separately. So now what is the next step to run the project with Glassfish? My IDE is eclipse.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:12:52+00:00Added an answer on June 5, 2026 at 5:12 am

    You have to first tell Maven to build the WAR, check out this plugin for that: http://maven.apache.org/plugins/maven-war-plugin/.

    Then you need to tell maven how to deploy to glassfish, you can either configure a Maven execution plugin to do this (see here: https://www.mojohaus.org/exec-maven-plugin/). Or you can look around for a custom plugin devoted to integrating maven with glassfish. This one looks promising, but I have not used it: http://maven-glassfish-plugin.java.net/.

    Maven provides a lot of basic functionality out of the box, but most of the cooler stuff with build automation is done through plugins.

    Update

    Just updating to add a very simple Pom that will do a auto-deployment. Note: if you just run a “mvn clean install”, with the packaging set to ‘war’, maven will build the .war file for you and place it in the target/ folder. You can take this and deploy it to glassfish manually if you just want to get started.

    Below is part of a very simple pom that uses the Maven execution plugin to auto-deploy to glassfish as a function of the build:

    <build>
      <plugins>
        <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
            <execution>
            <goals>
                  <goal>exec</goal>
            </goals>
            <phase>install</phase>
            </execution>
        </executions>
        <configuration>
            <executable>${path-to-asadmin-util}</executable>
            <arguments>
                <argument>deploy</argument>
                <argument>--user=${username}]</argument>
                <argument>--passwordfile=${password-file}</argument>
                <argument>--host=localhost</argument>
                <argument>--port=4848</argument>
                <argument>target/${project.name}</argument>
            </arguments>
        </configuration>
     </plugin>
     </plugins>
     </build>
    

    This basically just calls the deploy command on the glassfish asadmin utility[1]. You need to fill in the following variables:

    • ${path-to-asadmin-util} –> this is the path to your asadmin utility
      (normally in the glassfish_home/bin)
    • ${username} –> glassfish admin username
    • ${password-file} –> password file for logging into glassfish
      admin[2]
    • ${project.name} –> name of your war

    If you want to get more complicated I suggest taking a look at this thread: GlassFish v3 and glassfish-maven-plugin (Mac).

    [1] – http://docs.oracle.com/cd/E18930_01/html/821-2433/deploy-1.html#SJSASEEREFMANdeploy-1

    [2] – http://docs.oracle.com/cd/E18930_01/html/821-2435/ghgrp.html#ghytn

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a maven pom file for an open source project. This pom file
I have a maven project with a module /myProject pom.xml /myModule pom.xml /foo bar.txt
I have a muti-module maven project, and I created a new module that depends
I have produced a new Maven Project from gae-archetype-gwt from within IntelliJ, and everything
I'm trying to deserialize an XML file like this (it's actually a maven POM
I have a maven project Parent Project (with the following modules) (package type pom)
I have a Maven project that is packaged as jar . And I also
I have a maven-multi project, when I create a new eclipse project from it
Have upgraded to eclipse.indigo using a new installation. Added m2e. Maven shows up under
So I created a new maven pom based webapp using intelliJ 11. Now I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.