Added missing documentation for skip-configuration
[hibernate4-maven-plugin] / src / site / apt / skip.apt
1   ---
2   To Skip or not to skip: that is the question
3   ---
4   Kai Moritz
5   ---
6
7   In most use-cases, the hibernate4-maven-plugin is used to create a
8   test-database automatically. In this use-cases, it is very likely, that it
9   will result in mistakes/errors, if the goal is executed, when the tests
10   are skipped.
11   For example, one might manually overwrite the database-url with the url of
12   the production-database, in order to run other tests, like starting a
13   local webserver with the
14   {{{http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin}jetty-maven-plugin}}.
15   If the export-goal would be executed in such a scenario, it might erase the
16   hole production-database, which is not very desireable.
17
18   Because of this, the configuration-parameter <<<skip>>> defaults to the value
19   of the proptery <<<maven.test.skip>>>. This way, the execution of the
20   hibernate4-maven-plugin is skipped automatically, when the tests are
21   skipped. Think of it as a build-in security-belt.
22
23   If you do not like that, because you need the plugin to always execute the
24   export-goal, even if the tests are skipped you can configure that explicitly,
25   by setting the configuration-parameter <<<skip>>> to false:
26
27 ------------
28 <plugin>
29   <groupId>de.juplo</groupId>
30   <artifactId>hibernate4-maven-plugin</artifactId>
31   ...
32   <configuration>
33     <skip>false</skip>
34   </configuration>
35 </plugin>
36 ------------
37
38   Or, if you want the export-goal to be executed by default and to be skipped
39   if you say so, you can bind the value of the configuration-parameter
40   <<<skip>>> to a custom property. For example:
41
42 ------------
43 <plugin>
44   <groupId>de.juplo</groupId>
45   <artifactId>hibernate4-maven-plugin</artifactId>
46   ...
47   <configuration>
48     <skip>${foo.bar}</skip>
49   </configuration>
50 </plugin>
51 ------------
52
53   This way, the export-goal would be skipped, if you set the property
54   <<<foo.bar>>> to <<<true>>>. For example, if you specify <<<-Dfoo.bar=true>>>
55   on the command-line.