Skip to content

Commit facc6b5

Browse files
pesseSamuel Nitsche
authored andcommitted
Prepare and document maven profile for local execution
1 parent 9ab4d0f commit facc6b5

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed

README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,45 @@ http://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm#MAVEN901
9292

9393
*Sections 6.1 and 6.5 are the more important ones, and the only ones you need if you're using the latest Maven version.*
9494

95+
### Local database with utPLSQL and utPLSQL-demo-project
96+
97+
To usefully contribute you'll have to setup a local database with installed [latest utPLSQL v3](https://github.com/utPLSQL/utPLSQL) and [utPLSQL-demo-project](https://github.com/utPLSQL/utPLSQL-demo-project).
98+
The demo-project will serve as your test user. See .travis.yml to see an example on how it can be installed.
99+
100+
### Maven settings for utPLSQL-local profile
101+
102+
utPLSQL-java-api comes with a preconfigured profile "utPLSQL-local". This profile uses properties to set the correct
103+
environment variables for DB_URL, DB_USER and DB_PASS which is needed to run the integration tests.
104+
You can set these properties by adding the following to your Maven settings.xml:
105+
106+
```xml
107+
<settings>
108+
<!-- ... -->
109+
<profiles>
110+
<profile>
111+
<id>utPLSQL-local</id>
112+
<properties>
113+
<dbUrl>localhost:1521/XE</dbUrl>
114+
<dbUser>app</dbUser>
115+
<dbPass>app</dbPass>
116+
</properties>
117+
</profile>
118+
</profiles>
119+
120+
<activeProfiles>
121+
<activeProfile>utPLSQL-local</activeProfile>
122+
</activeProfiles>
123+
</settings>
124+
```
125+
95126
After configuring your access to Oracle's Maven repository, you will be able to successfully build this API.
96127

97128
```bash
98129
cd utPLSQL-java-api
99-
mvn clean package install -DskipTests
130+
mvn clean package install
100131
```
101132

102-
The cmd above is ignoring unit tests because it needs a database connection with the latest utPLSQL v3 installed. Please take a look on .travis.yml and .travis folder to see how testing was configured.
133+
### Skip the local database part
134+
135+
If you want to skip the local database part, just run ``mvn clean package install -DskipTests``.
136+
You will still be able to run ``mvn test`` because integration tests are run in the ``verify``-phase.

pom.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,29 @@
9393
</plugins>
9494
</build>
9595

96+
<profiles>
97+
<profile>
98+
<id>utPLSQL-local</id>
99+
<build>
100+
<pluginManagement>
101+
<plugins>
102+
<plugin>
103+
<groupId>org.apache.maven.plugins</groupId>
104+
<artifactId>maven-failsafe-plugin</artifactId>
105+
<configuration>
106+
<environmentVariables>
107+
<DB_URL>${dbUrl}</DB_URL>
108+
<DB_USER>${dbUser}</DB_USER>
109+
<DB_PASS>${dbPass}</DB_PASS>
110+
</environmentVariables>
111+
</configuration>
112+
</plugin>
113+
</plugins>
114+
</pluginManagement>
115+
</build>
116+
</profile>
117+
</profiles>
118+
96119
<distributionManagement>
97120
<repository>
98121
<id>packagecloud-utPLSQL</id>

0 commit comments

Comments
 (0)