views:

20

answers:

1

I used maven-glassfish-plugin create a new domain but file isn't existed master-password? Why? Command is glassfish:start-domain. My pom.xml declares the following:

   <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.1</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
                <encoding>utf-8</encoding>
            </configuration>
        </plugin>
        <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>
    <finalName>SSH2Maven</finalName>
</build>

The exception is : IoException

+1  A: 

I'm not sure the glassfish plugin can persist the master password in a file when creating a domain.

But you can do this on the command line:

$ asadmin change-master-password --savemasterpassword=true my-domain
Please enter the new master password>
Please enter the new master password again>
Master password changed for domain my-domain

The important part is the --savemasterpassword=true (put the generated file wherever you want).

For reference, you can also do this when creating a domain on the command line:

$ asadmin create-domain --savemasterpassword=true my-domain
Pascal Thivent
thx a lot, I hate a cmd mode, but trying uses
EdwardLau