Skip to content

Commit 58ad547

Browse files
authored
Create Maven "dev" profile (#1746)
The "dev" profile modifies the Maven build so that only the "openhab" module is built, and it builds to a folder instead of an archive. Each subsequent build will delete the "runtime" folder inside the built folder, so that subsequent builds can be done without "clean", allowing the configuration of the "OH installation" to persist across rebuilds. It can't be used with "mvn install", use "mvn package -Pdev" instead. The built folder is a ready to start OH installation, use "start_debug" to if you want to connect a debugger. Signed-off-by: Ravi Nadahar <nadahar@rediffmail.com>
1 parent c8824ae commit 58ad547

3 files changed

Lines changed: 72 additions & 6 deletions

File tree

distributions/openhab/pom.xml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,4 +282,48 @@
282282
</plugins>
283283
</build>
284284

285+
<profiles>
286+
<profile>
287+
<id>dev</id>
288+
<build>
289+
<plugins>
290+
<plugin>
291+
<artifactId>maven-clean-plugin</artifactId>
292+
<executions>
293+
<execution>
294+
<id>delete-runtime</id>
295+
<goals>
296+
<goal>clean</goal>
297+
</goals>
298+
<phase>initialize</phase>
299+
<configuration>
300+
<excludeDefaultDirectories>true</excludeDefaultDirectories>
301+
<filesets>
302+
<fileset>
303+
<directory>target/${project.artifactId}-${project.version}/runtime</directory>
304+
</fileset>
305+
</filesets>
306+
</configuration>
307+
</execution>
308+
</executions>
309+
</plugin>
310+
<plugin>
311+
<groupId>org.apache.maven.plugins</groupId>
312+
<artifactId>maven-assembly-plugin</artifactId>
313+
<executions>
314+
<execution>
315+
<id>archive</id>
316+
<configuration>
317+
<formats>
318+
<format>dir</format>
319+
</formats>
320+
</configuration>
321+
</execution>
322+
</executions>
323+
</plugin>
324+
</plugins>
325+
</build>
326+
</profile>
327+
</profiles>
328+
285329
</project>

distributions/pom.xml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,25 @@
1515

1616
<name>openHAB Distributions</name>
1717

18-
<modules>
19-
<module>openhab-addons</module>
20-
<module>openhab-demo</module>
21-
<module>openhab</module>
22-
<module>openhab-verify</module>
23-
</modules>
18+
<profiles>
19+
<profile>
20+
<id>dev</id>
21+
<modules>
22+
<module>openhab</module>
23+
</modules>
24+
</profile>
25+
<profile>
26+
<id>default</id>
27+
<activation>
28+
<activeByDefault>true</activeByDefault>
29+
</activation>
30+
<modules>
31+
<module>openhab-addons</module>
32+
<module>openhab-demo</module>
33+
<module>openhab</module>
34+
<module>openhab-verify</module>
35+
</modules>
36+
</profile>
37+
</profiles>
2438

2539
</project>

pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,14 @@
285285
<pax.url.suffix/>
286286
</properties>
287287
</profile>
288+
<profile>
289+
<id>dev</id>
290+
<properties>
291+
<build.number>- development build -</build.number>
292+
<online.repo>${oh.repo.releaseBaseUrl}/libs-snapshot</online.repo>
293+
<pax.url.suffix>@snapshots</pax.url.suffix>
294+
</properties>
295+
</profile>
288296
</profiles>
289297

290298
</project>

0 commit comments

Comments
 (0)