Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Commit cfa9012

Browse files
committed
Further modernize and clean up maven build.
Went through the pom.xml element by element and modernized each bit. * all plugins to latest stable compatible version * remove use of ant in favor of maven constructs * clean up website content, fix some broken pages / links * remove duplicate LICENSE/NOTICE files in favor of main files * stop trying to build NT*.ddl from maven pom and use binaries * update INSTALL file to point at binaries * various small tweaks and cleanups All tests pass including on windows with NT*.dll. All goals I can test work (release & deploy untested). All fixable build warnings fixed.
1 parent 490255f commit cfa9012

File tree

8 files changed

+107
-347
lines changed

8 files changed

+107
-347
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
target/
22
tests/output/
3+
.idea/

INSTALL

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,10 @@ Either Oracle JDK 6 or OpenJDK 6 is supported, but our pom expects vendor "oracl
9898
To rebuild log4j, place Maven 3 on the PATH and execute "mvn package".
9999
The resulting jar will be placed in the target subdirectory.
100100

101-
The build script will attempt to build NTEventLogAppender.dll if
102-
MinGW is available on the path. If the unit tests are run on Windows
103-
without NTEventLogAppender.dll, many warnings of the missing DLL
104-
will be generated. An installer for MinGW on Windows is
105-
available for download at http://sourceforge.net/project/showfiles.php?group_id=2435.
106-
MinGW is also available through the package managers of many Linux distributions.
101+
The main maven build will no longer automatically attempt to build
102+
NTEventLogAppender.dll or NTEventLogAppender.amd64.dll. To rebuild these
103+
files see src/ntdll/build.xml, and check in new versions into
104+
src/main/resources.
107105

108106
In case of problems send an e-mail note to
109107
log4j-user@logging.apache.org. Please do not directly e-mail any

pom.xml

Lines changed: 87 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Usage notes:
2020
2121
Building of NTEventLogappender.dll is disabled. Use an older log4j to get it.
2222
23-
-->
23+
-->
2424
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2525
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2626
<modelVersion>4.0.0</modelVersion>
@@ -32,9 +32,8 @@ Building of NTEventLogappender.dll is disabled. Use an older log4j to get it.
3232
<description>Apache Log4j 1.2 (UNMAINTAINED)</description>
3333
<url>http://logging.apache.org/log4j/1.2/</url>
3434
<issueManagement>
35-
<!-- not really, this is for 2.x, but Bugzilla for Log4j is also disabled -->
36-
<system>Jira</system>
37-
<url>https://issues.apache.org/jira/projects/LOG4J2</url>
35+
<system>GitHub</system>
36+
<url>https://github.com/apache/log4j/issues</url>
3837
</issueManagement>
3938
<inceptionYear>1999</inceptionYear>
4039
<mailingLists>
@@ -62,13 +61,17 @@ Building of NTEventLogappender.dll is disabled. Use an older log4j to get it.
6261
</licenses>
6362
<scm>
6463
<connection>scm:git:https://github.com/apache/log4j</connection>
65-
<developerConnection>scm:svn:https://gitbox.apache.org/repos/asf/logging-log4j1.git</developerConnection><!-- todo -->
66-
<url>https://gitbox.apache.org/repos/asf/logging-log4j2.git</url>
64+
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/logging-log4j1.git</developerConnection><!-- todo -->
65+
<url>https://gitbox.apache.org/repos/asf/logging-log4j1.git</url>
6766
</scm>
6867
<organization>
6968
<name>Apache Software Foundation</name>
7069
<url>http://www.apache.org</url>
7170
</organization>
71+
<properties>
72+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
73+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
74+
</properties>
7275
<build>
7376
<plugins>
7477
<plugin>
@@ -98,15 +101,59 @@ Building of NTEventLogappender.dll is disabled. Use an older log4j to get it.
98101
<configuration>
99102
<encoding>UTF-8</encoding>
100103
</configuration>
104+
<executions>
105+
<execution>
106+
<id>javadoc.resources</id>
107+
<phase>pre-site</phase>
108+
<goals>
109+
<goal>copy-resources</goal>
110+
</goals>
111+
<configuration>
112+
<outputDirectory>${project.build.directory}/apidocs/META-INF</outputDirectory>
113+
<resources>
114+
<resource>
115+
<directory>${project.basedir}</directory>
116+
<filtering>false</filtering>
117+
<includes>
118+
<include>LICENSE</include>
119+
<include>NOTICE</include>
120+
<include>README.md</include>
121+
</includes>
122+
</resource>
123+
</resources>
124+
</configuration>
125+
</execution>
126+
<execution>
127+
<id>ntdll.resources</id>
128+
<phase>process-resources</phase>
129+
<goals>
130+
<goal>copy-resources</goal>
131+
</goals>
132+
<configuration>
133+
<outputDirectory>${project.build.directory}</outputDirectory>
134+
<resources>
135+
<resource>
136+
<directory>${project.basedir}</directory>
137+
<filtering>false</filtering>
138+
<includes>
139+
<include>NTEventLogAppender.dll</include>
140+
<include>NTEventLogAppender.amd64.dll</include>
141+
</includes>
142+
</resource>
143+
</resources>
144+
</configuration>
145+
</execution>
146+
</executions>
101147
</plugin>
102148
<plugin>
103149
<artifactId>maven-surefire-plugin</artifactId>
104150
<version>2.22.2</version>
105151
<configuration>
106152
<workingDirectory>tests</workingDirectory>
107153
<reportFormat>plain</reportFormat>
108-
<forkMode>pertest</forkMode>
154+
<forkMode>pertest</forkMode><!-- deprecated, but tests fail when changing the setting -->
109155
<skip>false</skip>
156+
<argLine>-Djava.library.path=${project.basedir}</argLine>
110157
<includes>
111158
<include>org/apache/log4j/LevelTest.java</include>
112159
<include>org/apache/log4j/PriorityTest.java</include>
@@ -146,7 +193,7 @@ Building of NTEventLogappender.dll is disabled. Use an older log4j to get it.
146193
<include>org/apache/log4j/RFATestCase.java</include>
147194
<include>org/apache/log4j/varia/ERFATestCase.java</include>
148195
<include>org/apache/log4j/net/SyslogAppenderTest</include>
149-
<!--<include>org/apache/log4j/nt/NTEventLogAppenderTest</include>-->
196+
<include>org/apache/log4j/nt/NTEventLogAppenderTest</include>
150197
<include>org/apache/log4j/net/SocketAppenderTest</include>
151198
</includes>
152199
</configuration>
@@ -162,7 +209,7 @@ Building of NTEventLogappender.dll is disabled. Use an older log4j to get it.
162209
</plugin>
163210
<plugin>
164211
<artifactId>maven-jar-plugin</artifactId>
165-
<version>2.3</version>
212+
<version>3.2.0</version>
166213
<configuration>
167214
<archive>
168215
<manifestSections>
@@ -183,15 +230,12 @@ Building of NTEventLogappender.dll is disabled. Use an older log4j to get it.
183230
<artifactId>maven-antrun-plugin</artifactId>
184231
<version>3.0.0</version>
185232
<executions>
186-
<!-- release builds will put SVN tags into the SCM page, this changes it back to trunk -->
187233
<execution>
188234
<phase>site</phase>
189235
<id>untag-site</id>
190236
<configuration>
191237
<target>
192238
<taskdef name="replaceregexp" classname="org.apache.tools.ant.taskdefs.optional.ReplaceRegExp" />
193-
<replaceregexp file="target/site/source-repository.html" match="/tags/[^ &quot;'&lt;]*"
194-
replace="/trunk" flags="g" />
195239
<replaceregexp match="-- Generated by (.*) on .*--" replace="-- Generated by \1 --" flags="g">
196240
<fileset dir="target/site/apidocs" includes="**/*.html" />
197241
</replaceregexp>
@@ -201,41 +245,17 @@ Building of NTEventLogappender.dll is disabled. Use an older log4j to get it.
201245
<goal>run</goal>
202246
</goals>
203247
</execution>
204-
<execution>
205-
<id>javadoc.resources</id>
206-
<phase>pre-site</phase>
207-
<goals>
208-
<goal>run</goal>
209-
</goals>
210-
<configuration>
211-
<target>
212-
<copy todir="${project.build.directory}/apidocs/META-INF">
213-
<fileset dir="${basedir}">
214-
<include name="LICENSE" />
215-
<include name="NOTICE" />
216-
</fileset>
217-
</copy>
218-
</target>
219-
</configuration>
220-
</execution>
221248
</executions>
222249
</plugin>
223250
<plugin>
224251
<artifactId>maven-assembly-plugin</artifactId>
225-
<version>2.2-beta-5</version>
252+
<version>3.3.0</version>
226253
<configuration>
227254
<descriptors>
228255
<descriptor>src/assembly/bin.xml</descriptor>
229256
</descriptors>
230257
<appendAssemblyId>false</appendAssemblyId>
231258
</configuration>
232-
<executions>
233-
<execution>
234-
<goals>
235-
<goal>assembly</goal>
236-
</goals>
237-
</execution>
238-
</executions>
239259
</plugin>
240260
<plugin>
241261
<artifactId>maven-javadoc-plugin</artifactId>
@@ -244,7 +264,6 @@ Building of NTEventLogappender.dll is disabled. Use an older log4j to get it.
244264
<docfilessubdirs>true</docfilessubdirs>
245265
<excludedocfilessubdir>.svn</excludedocfilessubdir>
246266
<encoding>UTF-8</encoding>
247-
<docEncoding>UTF-8</docEncoding>
248267
</configuration>
249268
<executions>
250269
<execution>
@@ -264,15 +283,14 @@ Building of NTEventLogappender.dll is disabled. Use an older log4j to get it.
264283
</plugin>
265284
<plugin>
266285
<artifactId>maven-release-plugin</artifactId>
267-
<version>2.0-beta-9</version>
268-
<!-- Bug MRELEASE-273 has been throwing NPE during release:perform, typically after deploy so this places it last. -->
286+
<version>3.0.0-M4</version>
269287
<configuration>
270-
<goals>package site-deploy assembly:attached deploy</goals>
288+
<goals>package site-deploy assembly:single deploy</goals>
271289
</configuration>
272290
</plugin>
273291
<plugin>
274292
<artifactId>maven-source-plugin</artifactId>
275-
<version>2.1.1</version>
293+
<version>3.2.0</version>
276294
<executions>
277295
<execution>
278296
<goals>
@@ -281,20 +299,20 @@ Building of NTEventLogappender.dll is disabled. Use an older log4j to get it.
281299
</execution>
282300
</executions>
283301
</plugin>
284-
<!-- clirr:check will fail with NullPointerException due to missing javax.jms.MessageListener, however it will trigger
302+
<!-- clirr:check will fail with NullPointerException due to missing javax.jms.MessageListener, however it will trigger
285303
download of supporting components which can allow "ant clirr" to succeed. Could possibly run on a JavaEE platform. -->
286304
<plugin>
287305
<groupId>org.codehaus.mojo</groupId>
288306
<artifactId>clirr-maven-plugin</artifactId>
289-
<version>2.2.2</version>
307+
<version>2.8</version>
290308
<configuration>
291309
<comparisonVersion>1.2.15</comparisonVersion>
292310
</configuration>
293311
</plugin>
294312
<plugin>
295-
<groupId>org.codehaus.mojo</groupId>
296-
<artifactId>rat-maven-plugin</artifactId>
297-
<version>1.0-alpha-3</version>
313+
<groupId>org.apache.rat</groupId>
314+
<artifactId>apache-rat-plugin</artifactId>
315+
<version>0.13</version>
298316
<configuration>
299317
<excludes>
300318
<exclude>tests/witness/**</exclude>
@@ -330,17 +348,23 @@ Building of NTEventLogappender.dll is disabled. Use an older log4j to get it.
330348
<configuration>
331349
<templateFile>${basedir}/src/site/site-template.vm</templateFile>
332350
</configuration>
333-
<executions>
334-
<execution>
335-
<phase>package</phase>
336-
<goals>
337-
<goal>site</goal>
338-
</goals>
339-
</execution>
340-
</executions>
341351
</plugin>
342352
</plugins>
343353
<testSourceDirectory>tests/src/java</testSourceDirectory>
354+
<resources>
355+
<resource>
356+
<directory>${project.basedir}/src/main/resources</directory>
357+
</resource>
358+
<resource>
359+
<targetPath>META-INF</targetPath>
360+
<filtering>false</filtering>
361+
<directory>${project.basedir}</directory>
362+
<includes>
363+
<include>LICENSE</include>
364+
<include>NOTICE</include>
365+
</includes>
366+
</resource>
367+
</resources>
344368
<testResources>
345369
<testResource>
346370
<directory>tests/resources</directory>
@@ -351,27 +375,24 @@ Building of NTEventLogappender.dll is disabled. Use an older log4j to get it.
351375
<plugins>
352376
<plugin>
353377
<artifactId>maven-project-info-reports-plugin</artifactId>
354-
<version>2.4</version>
378+
<version>3.1.2</version>
355379
<reportSets>
356380
<reportSet>
357381
<reports>
358382
<report>scm</report>
359383
<report>dependencies</report>
360-
<report>cim</report>
361-
<report>issue-tracking</report>
362-
<report>mailing-list</report>
363-
<report>license</report>
384+
<report>mailing-lists</report>
364385
</reports>
365386
</reportSet>
366387
</reportSets>
367388
</plugin>
368389
<plugin>
369390
<artifactId>maven-jxr-plugin</artifactId>
370-
<version>2.1</version>
391+
<version>3.1.1</version>
371392
</plugin>
372393
<plugin>
373394
<artifactId>maven-changes-plugin</artifactId>
374-
<version>2.7</version>
395+
<version>2.12.1</version>
375396
<reportSets>
376397
<reportSet>
377398
<reports>
@@ -382,44 +403,13 @@ Building of NTEventLogappender.dll is disabled. Use an older log4j to get it.
382403
</plugin>
383404
</plugins>
384405
</reporting>
385-
<profiles>
386-
<profile>
387-
<id>mac</id>
388-
<activation>
389-
<os>
390-
<family>mac</family>
391-
</os>
392-
</activation>
393-
<properties>
394-
<m2_repo>${user.home}/.m2/repository</m2_repo>
395-
<ntdll_target>build</ntdll_target>
396-
</properties>
397-
</profile>
398-
<profile>
399-
<id>default</id>
400-
<activation>
401-
<activeByDefault>true</activeByDefault>
402-
</activation>
403-
<properties>
404-
<m2_repo>${user.home}/.m2/repository</m2_repo>
405-
<ntdll_target>build</ntdll_target>
406-
</properties>
407-
</profile>
408-
</profiles>
409-
<repositories>
410-
<repository>
411-
<id>maven2-repository.dev.java.net</id>
412-
<name>Java.net Repository for Maven</name>
413-
<url>http://download.java.net/maven/2/</url>
414-
<layout>default</layout>
415-
</repository>
416-
</repositories>
417406
<dependencies>
418407
<dependency>
419-
<groupId>javax.mail</groupId>
420-
<artifactId>mail</artifactId>
421-
<version>1.4.3</version>
408+
<groupId>jakarta.mail </groupId>
409+
<artifactId>jakarta.mail-api</artifactId>
410+
<version>2.0.1</version>
422411
<optional>true</optional>
412+
<scope>provided</scope>
423413
</dependency>
424414
<dependency>
425415
<groupId>org.apache.openejb</groupId>
@@ -428,8 +418,6 @@ Building of NTEventLogappender.dll is disabled. Use an older log4j to get it.
428418
<type>jar</type>
429419
<scope>provided</scope>
430420
</dependency>
431-
<!-- the following dependency is not needed on JDK 1.5 and higher <dependency> <groupId>com.sun.jmx</groupId> <artifactId>jmxri</artifactId>
432-
<version>1.2.1</version> <optional>true</optional> </dependency> -->
433421
<dependency>
434422
<groupId>oro</groupId>
435423
<artifactId>oro</artifactId>

0 commit comments

Comments
 (0)