-
Notifications
You must be signed in to change notification settings - Fork 97
/
index.html
137 lines (120 loc) · 5.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
---
layout: maven
pill: overview
subtitle: Maven Plugin
---
<div id="mavenPlugin">
<h1>Maven Plugin</h1>
<h2>Installation</h2>
<pre class="prettyprint"><plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>{{ site.flywayVersion }}</version>
<configuration>
....
</configuration>
</plugin></pre>
<h2>Goals</h2>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th><strong>Name</strong></th>
<th><strong>Description</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="/documentation/maven/migrate.html">migrate</a></td>
<td>Migrates the database</td>
</tr>
<tr>
<td><a href="/documentation/maven/clean.html">clean</a></td>
<td>Drops all objects in the configured schemas</td>
</tr>
<tr>
<td><a href="/documentation/maven/info.html">info</a></td>
<td>Prints the details and status information about all the migrations</td>
</tr>
<tr>
<td><a href="/documentation/maven/validate.html">validate</a></td>
<td>Validates the applied migrations against the ones available on the classpath</td>
</tr>
<tr>
<td><a href="/documentation/maven/init.html">init</a></td>
<td>Creates and initializes the metadata table (existing database)</td>
</tr>
<tr>
<td><a href="/documentation/maven/repair.html">repair</a></td>
<td>Repairs the metadata table</td>
</tr>
</tbody>
</table>
<h2>Configuration</h2>
<p>The Flyway Maven plugin can be configured in the following ways:</p>
<h3>Directly in the configuration of the plugin</h3>
<pre class="prettyprint"><plugin>
...
<configuration>
<user>myUser</user>
<password>mySecretPwd</password>
<schemas>
<schema>schema1</schema>
<schema>schema2</schema>
<schema>schema3</schema>
</schemas>
<placeholders>
<keyABC>valueXYZ</keyABC>
<otherplaceholder>value123</otherplaceholder>
</placeholders>
</configuration>
</plugin></pre>
<div class="well well-small">
<strong>Limitation: </strong> Due to a <a href="http://mail-archives.apache.org/mod_mbox/maven-users/200708.mbox/%3C5a2cf1f60708090246l216f156esf46cc1e968b37ccd@mail.gmail.com%3E">long standing Maven bug</a> it is not possible to configure
empty values this way. You must use one of the other configurations ways instead.
</div>
<h3>Through Maven properties</h3>
<pre class="prettyprint"><project>
...
<properties>
<!-- Properties are prefixed with flyway. -->
<flyway.user>myUser</flyway.user>
<flyway.password>mySecretPwd</flyway.password>
<!-- List are defined as comma-separated values -->
<flyway.schemas>schema1,schema2,schema3</schema>
<!-- Individual placeholders are prefixed by flyway.placeholders. -->
<flyway.placeholders.keyABC>valueXYZ</flyway.placeholders.keyABC>
<flyway.placeholders.otherplaceholder>value123</flyway.placeholders.otherplaceholder>
</properties>
...
</project></pre>
<h3>Through an external config file</h3>
<pre class="console">mvn -Dflyway.configFile=myConfig.properties</pre>
<p>Default is <code>flyway.properties</code> in the same directory as the POM.<br/>
Encoding is specified by <code>flyway.encoding</code> (Default: UTF-8)</p>
<pre class="prettyprint">flyway.user=myUser
flyway.password=mySecretPwd
flyway.schemas=schema1,schema2,schema3
flyway.placeholders.keyABC=valueXYZ
flyway.placeholders.otherplaceholder=value123</pre>
<h3>Through System properties</h3>
<pre class="console">mvn -Dflyway.user=myUser -Dflyway.schemas=schema1,schema2 -Dflyway.placeholders.keyABC=valueXYZ</pre>
<h3>Overriding order</h3>
<p>System properties > External config file > Maven properties > Plugin configuration</p>
<h2>Authentication</h2>
<p>Besides configuring credentials through one of the 3 ways described above, it is also possible to externalize
them in the Maven <strong>settings.xml</strong> file:</p>
<pre class="prettyprint"><settings>
<servers>
<server>
<!-- By default Flyway will look for the server with the id 'flyway-db' -->
<!-- This can be customized by configuring the 'serverId' property -->
<id>flyway-db</id>
<username>myUser</username>
<password>mySecretPwd</password>
</server>
</servers>
</settings></pre>
<p class="next-steps">
<a class="btn btn-primary" href="/documentation/maven/migrate.html">Maven: migrate <i class="fa fa-arrow-right"></i></a>
</p>
</div>