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

  • Home
  • SEARCH
  • 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 508843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:56:57+00:00 2026-05-13T06:56:57+00:00

I’m trying to use the glassfish-maven-plugin ( https://maven-glassfish-plugin.dev.java.net/ ) with GlassFish v3 (I’m on

  • 0

I’m trying to use the glassfish-maven-plugin (https://maven-glassfish-plugin.dev.java.net/) with GlassFish v3 (I’m on a Mac and using Eclipse) and I can’t seem to get my web app to deploy. I keep running into:

The Master Password is required to start the domain. No console, no prompting possible. You should either create the domain with –savemasterpassword=true or provide a password file with the –passwordfile option.

Here is the relevant portion of my POM file.

<profiles>
    <profile>
        <id>development</id>
        <activation>
            <property>
                <name>phase</name>
                <value>development</value>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.glassfish.maven.plugin</groupId>
                    <artifactId>maven-glassfish-plugin</artifactId>
                    <version>2.2-SNAPSHOT</version>
                    <configuration>
                        <glassfishDirectory>${glassfish.directory}</glassfishDirectory>
                        <user>${glassfish.user}</user>
                        <passFile>${glassfish.directory}/domains/${project.artifactId}/config/domain-passwords</passFile>
                        <domain>
                            <name>${project.artifactId}</name>
                        </domain>
                        <components>
                            <component>
                                <name>${project.artifactId}</name>
                                <artifact>${project.build.directory}/artifacts/${project.artifactId}.war</artifact>
                            </component>
                        </components>
                    </configuration>
                </plugin>
            </plugins>
        </build>
        <pluginRepositories>
            <pluginRepository>
                <id>ocean</id>
                <url>http://maven.ocean.net.au/snapshot</url>
                <releases>
                    <enabled>false</enabled>
                    <updatePolicy>never</updatePolicy>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                    <updatePolicy>always</updatePolicy>
                </snapshots>
            </pluginRepository>
        </pluginRepositories>
    </profile>
</profiles>

Here is the start-domain command Maven is executing.

asadmin –host localhost –port 4848 –user admin –passwordfile /var/folders/sk/skcc8rAVGSynOBBaOwWN3U+++TI/-Tmp-/mgfp5377058868244877698.tmp –interactive=false –echo=true –terse=true start-domain –debug=false –domaindir /Applications/GlassFish/v3/glassfish/domains –help=false –upgrade=false –verbose=false mvnrepo

The –passwordfile is using a temp file so I’m guessing that is the problem. For some reason the passFile parameter isn’t working.

Any ideas? I’m I wrong with my assumption?

  • 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-05-13T06:56:58+00:00Added an answer on May 13, 2026 at 6:56 am

    In the Fairly Complete Configuration Example, there is indeed a reference to the <passFile> element but the documentation of the various goals doesn’t mention this element and refer to <passwordFile> instead (see for example glassfish:start-domain or glassfish:deploy). So, try to update the configuration of your plugin in your profile accordingly:

    <plugin>
      <groupId>org.glassfish.maven.plugin</groupId>
      <artifactId>maven-glassfish-plugin</artifactId>
      <version>2.2-SNAPSHOT</version>
      <configuration>
        <glassfishDirectory>${glassfish.directory}</glassfishDirectory>
        <user>${glassfish.user}</user>
        <passwordFile>${glassfish.directory}/domains/${project.artifactId}/config/domain-passwords</passwordFile>
        <domain>
          <name>${project.artifactId}</name>
        </domain>
        <components>
          <component>
            <name>${project.artifactId}</name>
            <artifact>${project.build.directory}/artifacts/${project.artifactId}.war</artifact>
          </component>
        </components>
      </configuration>
    </plugin>
    

    As a side note, I recommend the maven-embedded-glassfish-plugin which allows to run Glassfish in a single JVM using its embedded API. Very nice. See Using maven plugin for v3 embedded glassfish for more details.

    UPDATE: I did some further testing and, couldn’t actually reproduce your problem on my machine (sigh).

    First, I created a new domain by executing the following command (from <glassfish_home>/bin):

    $ ./asadmin create-domain  --savemasterpassword=true maven-glassfish-testcase
    

    Then, I created a new webapp using maven’s webapp archetype:

    $ mvn archetype:create -DgroupId=com.mycompany.app \
          -DartifactId=maven-glassfish-testcase \
          -DarchetypeArtifactId=maven-archetype-webapp
    

    And updated the pom.xml of the freshly created webapp as follow:

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>com.mycompany.app</groupId>
      <artifactId>maven-glassfish-testcase</artifactId>
      <packaging>war</packaging>
      <version>1.0-SNAPSHOT</version>
      <name>maven-glassfish-testcase Maven Webapp</name>
      <url>http://maven.apache.org</url>
      <properties>
        <glassfish.home>/home/pascal/opt/glassfishv3/glassfish</glassfish.home>
        <domain.username>admin</domain.username>
      </properties>
      <pluginRepositories>
        <pluginRepository>
          <id>ocean</id>
          <url>http://maven.ocean.net.au/snapshot</url>
          <releases>
            <enabled>false</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
      <dependencies>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>3.8.1</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <finalName>maven-glassfish-testcase</finalName>
        <plugins>
          <plugin>
            <groupId>org.glassfish.maven.plugin</groupId>
            <artifactId>maven-glassfish-plugin</artifactId>
            <version>2.2-SNAPSHOT</version>
            <configuration>
              <glassfishDirectory>${glassfish.home}</glassfishDirectory>
              <user>${domain.username}</user>
              <passwordFile>${glassfish.home}/domains/${project.artifactId}/master-password</passwordFile>
              <debug>true</debug>
              <echo>true</echo>
              <domain>
                <name>${project.artifactId}</name>
                <adminPort>4848</adminPort> <!-- mandatory for mvn glassfish:deploy -->
              </domain>
              <components>
                <component>
                  <name>${project.artifactId}</name>
                  <artifact>${project.build.directory}/${project.build.finalName}.war</artifact>
                </component>
              </components>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </project>
    

    With this setup, running mvn glassfish:start-domain produces the following output:

    $ mvn glassfish:start-domain
    [INFO] Scanning for projects...
    [INFO] snapshot org.glassfish.maven.plugin:maven-glassfish-plugin:2.2-SNAPSHOT: checking for updates from ocean
    [INFO] ------------------------------------------------------------------------
    [INFO] Building maven-glassfish-testcase Maven Webapp
    [INFO]    task-segment: [glassfish:start-domain]
    [INFO] ------------------------------------------------------------------------
    [INFO] [glassfish:start-domain {execution: default-cli}]
    [INFO] asadmin --host localhost --port 4848 --user admin --passwordfile /home/pascal/opt/glassfishv3/glassfish/domains/maven-glassfish-testcase/master-password --interactive=false --echo=true --terse=true start-domain --debug=true --domaindir /home/pascal/opt/glassfishv3/glassfish/domains --help=false --upgrade=false --verbose=false maven-glassfish-testcase
    [INFO] Started domain: maven-glassfish-testcase
    [INFO] Domain location: /home/pascal/opt/glassfishv3/glassfish/domains/maven-glassfish-testcase
    [INFO] Log file: /home/pascal/opt/glassfishv3/glassfish/domains/maven-glassfish-testcase/logs/server.log
    [INFO] Admin port for the domain: 4848
    [INFO] Debug port for the domain: 9009
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESSFUL
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 27 seconds
    [INFO] Finished at: Mon Dec 21 20:16:17 CET 2009
    [INFO] Final Memory: 4M/53M
    [INFO] ------------------------------------------------------------------------
    

    As you can see, the --passwordfile option is passed correctly using the file specified in the POM. In other words, things are working as expected. Maybe try with an hard coded path to the password file to debug this setting, it should just work!

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

Sidebar

Ask A Question

Stats

  • Questions 367k
  • Answers 367k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer When you add an event handler to an event (or… May 14, 2026 at 4:47 pm
  • Editorial Team
    Editorial Team added an answer You can use the inbuilt php function json_encode() http://php.net/manual/en/function.json-encode.php To… May 14, 2026 at 4:47 pm
  • Editorial Team
    Editorial Team added an answer If you're passing in initial values, you should use the… May 14, 2026 at 4:47 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.