Skip to content

Commit 66bd73e

Browse files
committed
HBX-3127: Actualize the Ant Reference Guide for Reverse Engineering
- Change the delimiters in 'common/included.xml' so that the examples are usable straight from a command-line - Adapt the instructions in the README.md files to add the needed arguments - Reorder and provide comments for some plugin executions in 'ant/pom.xml' file and add the '${hibernate.version}' property Signed-off-by: Koen Aers <[email protected]>
1 parent 16792db commit 66bd73e

File tree

9 files changed

+55
-38
lines changed

9 files changed

+55
-38
lines changed

ant/docs/examples/5-minute-tutorial/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@
1616
To run this example:
1717
- Have [Apache Ant](https://ant.apache.org) installed
1818
- Have [H2 Sakila database](https://github.com/hibernate/sakila-h2) running
19-
- Issue `ant` from a command-line window
19+
- Issue `ant -Dhibernate.version=${hibernate.version} -Dh2.version=${h2.version} -Djavaee-api.version=${javaee-api.version}`
20+
from a command-line window opened in this folder
21+

ant/docs/examples/classpath/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
-->
1616
To run this example:
1717
- Have [Apache Ant](https://ant.apache.org) installed
18-
- Issue `ant` from a command-line window
18+
- Issue `ant -Dhibernate.version=${hibernate.version} -Dh2.version=${h2.version} -Djavaee-api.version=${javaee-api.version}`
19+
from a command-line window opened in this folder

ant/docs/examples/common/included.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
-->
1616
<project name="common" xmlns:ivy="antlib:org.apache.ivy.ant">
1717

18-
<property name="hibernate-tools.version" value="@project.version@"/>
19-
<property name="javaee-api.version" value="@javaee-api.version@"/>
18+
<property name="hibernate-tools.version" value="${hibernate.version}"/>
19+
<property name="javaee-api.version" value="${javaee-api.version}"/>
2020
<property name="jdbc-driver.org" value="com.h2database"/>
2121
<property name="jdbc-driver.module" value="h2"/>
22-
<property name="jdbc-driver.version" value="@h2.version@"/>
22+
<property name="jdbc-driver.version" value="${h2.version}"/>
2323

2424
<ivy:cachepath
2525
organisation="org.hibernate.tool"

ant/docs/examples/configuration/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
-->
1616
To run this example:
1717
- Have [Apache Ant](https://ant.apache.org) installed
18-
- Issue `ant` from a command-line window
18+
- Issue `ant -Dhibernate.version=${hibernate.version} -Dh2.version=${h2.version} -Djavaee-api.version=${javaee-api.version}`
19+
from a command-line window opened in this folder

ant/docs/examples/jpa/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
-->
1616
To run this example:
1717
- Have [Apache Ant](https://ant.apache.org) installed
18-
- Issue `ant` from a command-line window
18+
- Issue `ant -Dhibernate.version=${hibernate.version} -Dh2.version=${h2.version} -Djavaee-api.version=${javaee-api.version}`
19+
from a command-line window opened in this folder

ant/docs/examples/native/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
-->
1616
To run this example:
1717
- Have [Apache Ant](https://ant.apache.org) installed
18-
- Issue `ant` from a command-line window
18+
- Issue `ant -Dhibernate.version=${hibernate.version} -Dh2.version=${h2.version} -Djavaee-api.version=${javaee-api.version}`
19+
from a command-line window opened in this folder

ant/docs/examples/properties/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
-->
1616
To run this example:
1717
- Have [Apache Ant](https://ant.apache.org) installed
18-
- Issue `ant` from a command-line window
18+
- Issue `ant -Dhibernate.version=${hibernate.version} -Dh2.version=${h2.version} -Djavaee-api.version=${javaee-api.version}`
19+
from a command-line window opened in this folder

ant/docs/examples/templatepath/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
To run this example:
1717
- Have [Apache Ant](https://ant.apache.org) installed
1818
- Have [H2 Sakila database](https://github.com/hibernate/sakila-h2) running
19-
- Issue `ant` from a command-line window
19+
- Issue `ant -Dhibernate.version=${hibernate.version} -Dh2.version=${h2.version} -Djavaee-api.version=${javaee-api.version}`
20+
from a command-line window opened in this folder

ant/pom.xml

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
<properties>
3434
<!-- This is a publicly distributed module that should be published: -->
3535
<deploy.skip>false</deploy.skip>
36+
<!-- To run the integration tests we need to set ${hibernate.version} -->
37+
<hibernate.version>${project.version}</hibernate.version>
3638
</properties>
3739

3840
<dependencies>
@@ -68,33 +70,10 @@
6870

6971
<build>
7072
<plugins>
71-
<plugin>
72-
<groupId>org.apache.maven.plugins</groupId>
73-
<artifactId>maven-resources-plugin</artifactId>
74-
<executions>
75-
<execution>
76-
<id>filter-test-resources</id>
77-
<phase>process-test-resources</phase>
78-
<goals>
79-
<goal>testResources</goal>
80-
</goals>
81-
<configuration>
82-
<resources>
83-
<resource>
84-
<directory>${project.build.testOutputDirectory}</directory>
85-
<filtering>true</filtering>
86-
<includes>
87-
<include>common/included.xml</include>
88-
</includes>
89-
</resource>
90-
</resources>
91-
<delimiters>
92-
<delimiter>@*@</delimiter>
93-
</delimiters>
94-
</configuration>
95-
</execution>
96-
</executions>
97-
</plugin>
73+
<!-- Prepare the integration tests :
74+
* Add the 'src/it/java' folder as as source of additional tests (only contains integration tests)
75+
* Add the contents of the 'docs/examples' folder as additional test resources
76+
-->
9877
<plugin>
9978
<groupId>org.codehaus.mojo</groupId>
10079
<artifactId>build-helper-maven-plugin</artifactId>
@@ -130,8 +109,38 @@
130109
</execution>
131110
</executions>
132111
</plugin>
112+
<!-- Prepare the integration tests
113+
* Filter the 'common/included.xml' file, and replace the delimited values with their actual properties
114+
-->
115+
<plugin>
116+
<groupId>org.apache.maven.plugins</groupId>
117+
<artifactId>maven-resources-plugin</artifactId>
118+
<executions>
119+
<execution>
120+
<id>filter-test-resources</id>
121+
<phase>process-test-resources</phase>
122+
<goals>
123+
<goal>testResources</goal>
124+
</goals>
125+
<configuration>
126+
<resources>
127+
<resource>
128+
<directory>${project.build.testOutputDirectory}</directory>
129+
<filtering>true</filtering>
130+
<includes>
131+
<include>common/included.xml</include>
132+
</includes>
133+
</resource>
134+
</resources>
135+
<delimiters>
136+
<delimiter>@*@</delimiter>
137+
</delimiters>
138+
</configuration>
139+
</execution>
140+
</executions>
141+
</plugin>
142+
<!-- run the integration tests -->
133143
<plugin>
134-
<!-- run the integration tests -->
135144
<groupId>org.apache.maven.plugins</groupId>
136145
<artifactId>maven-failsafe-plugin</artifactId>
137146
<executions>

0 commit comments

Comments
 (0)