Question

I recently upgraded to the recently released Glassfish 4.0 together with Java EE 7. But I am having issues on using the Maven Glassfish plugin. It doesn's seem to pick the values stored in my project pom.xml

        <plugin>
            <groupId>org.glassfish.maven.plugin</groupId>
            <artifactId>maven-glassfish-plugin</artifactId>
            <version>${org.glassfish.maven.plugin.maven-glassfish-plugin.version}</version>
            <configuration>
                <glassfishDirectory>${glassfish.home}</glassfishDirectory>
                <user>${domain.username}</user>
                <adminPassword>${domain.password}</adminPassword>
                <passFile>${glassfish.home}/domains/domain1/config/domain-passwords</passFile>
                <autoCreate>true</autoCreate>
                <debug>true</debug>
                <echo>true</echo>
                <terse>true</terse>
                <skip>${test.int.skip}</skip>
                <domain>
                    <name>${domain.name}</name>

// ... rest of file

After upgrading from v3 to v4 the user and adminPassword properties are not picked when I execute mvn glassfish:deploy - as a result I get:

[ERROR] Authentication failed for user: admin [ERROR] with password from password file: C:/Users/jhondoe/.../.../Temp/mgfp6122921747148315370.tmp

the Maven Glassfish plugin command is skiping my user and password params for the plugin in pom.xml.

So by the meamwhile I must deploy manually to be able to test my app.

I wan't to avoid having to always manually deploy the EAR file I am not sure if there's a way of passing the params via command line. If someone knows about any possible solution let me know! Thanks!

Was it helpful?

Solution

If you installed a default GlassFish 4 instance, then there is only the admin user with no password. The password file for that user is in the domain configuration directory named "admin-keyfile". In this situation when you access the GlassFish admin console no authentication is required.

In your plugin configuration just provide the user and the password file (delete the adminPassword entry):

    <user>admin</user>
    <passwordFile>[...]\domains\domain1\config\admin-keyfile</passwordFile>

If you decide to change the admin password with the asadmin utility then change the plugin configuration in your pom.xml as follows:

    <user>admin</user>
    <adminPassword>YOUR_NEW_PASSWORD</adminPassword>

For further details check the Security Guide in the GlassFish 4 Documentation (https://glassfish.java.net/docs/4.0/security-guide.pdf)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top