# Dev Examples

The dev goal allows you to run a local instance of WildFly and watches the source directories for changes. If required your deployment will be recompiled and possibly redeployed. This allows for more rapid development. Do note that large deployments may take longer to deploy.

## Run overriding the feature pack location

The example below shows how to run a server overriding the feature pack location:

    <project>
        ...
        <build>
            ...
            <plugins>
                ...
                <plugin>
                    <groupId>org.wildfly.plugins</groupId>
                    <artifactId>wildfly-maven-plugin</artifactId>
                    <version>5.0.1.Final</version>
                    <configuration>
                        <feature-pack-location>wildfly-preview@maven(org.jboss.universe:community-universe)</feature-pack-location>
                    </configuration>
                </plugin>
                ...
            </plugins>
            ...
        </build>
    ...
    </project>

## Run ignoring redeployment if properties files are changed

The example below shows how to ignore properties files from triggering a redeploy:

    <project>
        ...
        <build>
            ...
            <plugins>
                ...
                <plugin>
                    <groupId>org.wildfly.plugins</groupId>
                    <artifactId>wildfly-maven-plugin</artifactId>
                    <version>5.0.1.Final</version>
                    <configuration>
                        <webExtensions>
                            <webExtension>.properties</webExtension>
                        </webExtensions>
                    </configuration>
                </plugin>
                ...
            </plugins>
            ...
        </build>
    ...
    </project>

## Add a user before running the server

The example below shows how to add a user before running the server

    <project>
        ...
        <build>
            ...
            <plugins>
                ...
                <plugin>
                    <groupId>org.wildfly.plugins</groupId>
                    <artifactId>wildfly-maven-plugin</artifactId>
                    <version>5.0.1.Final</version>
                    <configuration>
                        <add-user>
                            <users>
                                <user>
                                    <username>admin</username>
                                    <password>admin.1234</password>
                                </user>
                                <user>
                                    <username>admin-user</username>
                                    <password>user.1234</password>
                                    <groups>
                                        <group>admin</group>
                                        <group>user</group>
                                    </groups>
                                    <application-user>true</application-user>
                                </user>
                                <user>
                                    <username>default-user</username>
                                    <password>user.1234</password>
                                    <groups>
                                        <group>user</group>
                                    </groups>
                                    <application-user>true</application-user>
                                </user>
                            </users>
                        </add-user>
                    </configuration>
                </plugin>
                ...
            </plugins>
            ...
        </build>
    ...
    </project>

## Enable debugging

The example below shows how to run a server in dev mode with debugging enabled

    <project>
        ...
        <build>
            ...
            <plugins>
                ...
                <plugin>
                    <groupId>org.wildfly.plugins</groupId>
                    <artifactId>wildfly-maven-plugin</artifactId>
                    <version>5.0.1.Final</version>
                    <configuration>
                        <debug>true</debug>
                        <debugPort>5005</debugPort>
                        <debugSuspend>true</debugSuspend>
                    </configuration>
                </plugin>
                ...
            </plugins>
            ...
        </build>
    ...
    </project>