Skip to content

Commit 62a3c92

Browse files
committed
Create a single maven build
1 parent 2d204e9 commit 62a3c92

File tree

5 files changed

+69
-117
lines changed

5 files changed

+69
-117
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@ bash getXXX.sh <your-config-file>
1717

1818
## Building from source
1919

20-
Use `mvn install` to build the exporter servlets.
20+
Use `mvn install` to build the web application. This will create `monitoring-exporter-<version>`, where <version>
21+
is the Maven-assigned version number. This can be deployed to WLS.
2122

22-
Then `cd webapp & mvn package` to build the web application `wls-exporter.war`, which can then be deployed to WLS.
23-
24-
Adding `-Dconfiguration=<some-config-file>` will create a web application with the specified configuration as its default.
23+
Adding `-Dconfiguration=<some-config-file>` will insert the specified configuration as its default.
2524

2625
## Configuration
2726
Here is an example `yaml` configuration:

pom.xml

Lines changed: 66 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
88
<modelVersion>4.0.0</modelVersion>
99

10-
<groupId>io.prometheus.wls</groupId>
11-
<artifactId>wls-exporter</artifactId>
12-
<version>1.0-SNAPSHOT</version>
10+
<groupId>com.oracle.wls.exporter</groupId>
11+
<artifactId>monitoring-exporter</artifactId>
12+
<version>1.2.0-SNAPSHOT</version>
13+
<packaging>war</packaging>
1314

1415
<name>WebLogic Monitoring Exporter</name>
1516
<description>A Prometheus exporter that takes advantage of WebLogic Server-specific features.</description>
@@ -30,18 +31,37 @@
3031
</developer>
3132
</developers>
3233

34+
<properties>
35+
<configuration.directory>${project.build.directory}/configuration</configuration.directory>
36+
</properties>
37+
3338
<build>
34-
<plugins>
35-
<plugin>
36-
<groupId>org.apache.maven.plugins</groupId>
37-
<artifactId>maven-compiler-plugin</artifactId>
38-
<version>3.6.1</version>
39-
<configuration>
40-
<source>1.8</source>
41-
<target>1.8</target>
42-
</configuration>
43-
</plugin>
44-
</plugins>
39+
<pluginManagement>
40+
<plugins>
41+
<plugin>
42+
<artifactId>maven-war-plugin</artifactId>
43+
<version>2.6</version>
44+
<configuration>
45+
<failOnMissingWebXml>false</failOnMissingWebXml>
46+
<warSourceDirectory>${configuration.directory}</warSourceDirectory>
47+
<webResources>
48+
<resource>
49+
<directory>${project.basedir}/src/main/notices</directory>
50+
</resource>
51+
</webResources>
52+
</configuration>
53+
</plugin>
54+
<plugin>
55+
<groupId>org.apache.maven.plugins</groupId>
56+
<artifactId>maven-compiler-plugin</artifactId>
57+
<version>3.6.1</version>
58+
<configuration>
59+
<source>1.8</source>
60+
<target>1.8</target>
61+
</configuration>
62+
</plugin>
63+
</plugins>
64+
</pluginManagement>
4565
</build>
4666

4767
<dependencies>
@@ -137,4 +157,36 @@
137157
</dependency>
138158
</dependencies>
139159

160+
<profiles>
161+
<profile>
162+
<id>initial-configuration</id>
163+
<activation>
164+
<property>
165+
<name>configuration</name>
166+
</property>
167+
</activation>
168+
<build>
169+
<plugins>
170+
<plugin>
171+
<groupId>com.coderplus.maven.plugins</groupId>
172+
<artifactId>copy-rename-maven-plugin</artifactId>
173+
<version>1.0</version>
174+
<executions>
175+
<execution>
176+
<id>copy-configuration</id>
177+
<phase>generate-resources</phase>
178+
<goals>
179+
<goal>copy</goal>
180+
</goals>
181+
<configuration>
182+
<sourceFile>${configuration}</sourceFile>
183+
<destinationFile>${configuration.directory}/config.yml</destinationFile>
184+
</configuration>
185+
</execution>
186+
</executions>
187+
</plugin>
188+
</plugins>
189+
</build>
190+
</profile>
191+
</profiles>
140192
</project>

webapp/pom.xml

Lines changed: 0 additions & 99 deletions
This file was deleted.

0 commit comments

Comments
 (0)