Last active
October 14, 2019 12:30
-
-
Save Ameausoone/4714699 to your computer and use it in GitHub Desktop.
exec-maven-plugin for start H2 database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<profiles> | |
<profile> | |
<id>start-h2</id> | |
<dependencies> | |
<dependency> | |
<groupId>com.h2database</groupId> | |
<artifactId>h2</artifactId> | |
<version>1.3.162</version> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>exec-maven-plugin</artifactId> | |
<version>1.2.1</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>java</goal> | |
</goals> | |
</execution> | |
</executions> | |
<configuration> | |
<mainClass>org.h2.tools.Server</mainClass> | |
<arguments> | |
<!-- Start also UI --> | |
<argument>-web</argument> | |
<!-- db is available via tcp --> | |
<argument>-tcp</argument> | |
<!-- local file is present in project--> | |
<argument>-baseDir</argument> | |
<argument>${basedir}/${local-h2-directory}</argument> | |
<!-- Other computers can connect to this db --> | |
<argument>-webAllowOthers</argument> | |
<argument>-webPort</argument> | |
<argument>${h2database.port}</argument> | |
<!-- uncomment if you want to open h2 UI automatically --> | |
<!-- <argument>-browser</argument> --> | |
</arguments> | |
</configuration> | |
</plugin> | |
</plugins> | |
</build> | |
</profile> | |
</profiles> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for the gist. I tried the above along with
<activeProfiles>
redhat-ga-repository<activeProfile>start-h2</activeProfile> </activeProfiles>
Also under profile I have added
<activation> <activeByDefault>true</activeByDefault> </activation>
However the h2 web console does not start. Anything I am missing here ?