Skip to content

Commit fe6bc38

Browse files
committed
release 7.2.1
1 parent 239fb92 commit fe6bc38

File tree

9 files changed

+246
-24
lines changed

9 files changed

+246
-24
lines changed

README.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
![Logo](assets/github1280x640.png)
22

33
[![License Apache 2.0](https://img.shields.io/badge/license-Apache%20License%202.0-green.svg)](http://www.apache.org/licenses/LICENSE-2.0)
4-
[![Maven central](https://img.shields.io/badge/maven%20central-7.2.0-green.svg)](https://search.maven.org/#artifactdetails|com.igormaznitsa|jcp|7.2.0|jar)
4+
[![Maven central](https://img.shields.io/badge/maven%20central-7.2.1-green.svg)](https://search.maven.org/#artifactdetails|com.igormaznitsa|jcp|7.2.1|jar)
55
[![Java 11+](https://img.shields.io/badge/java-11%2b-green.svg)](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
66
[![Maven 3.0+](https://img.shields.io/badge/maven-3.0%2b-green.svg)](https://maven.apache.org/)
77
[![Gradle 6.0+](https://img.shields.io/badge/gradle-6.0%2b-green.svg)](https://gradle.org/)
@@ -10,6 +10,11 @@
1010

1111
# Changelog
1212

13+
__7.2.1 (21-jul-2025)__
14+
15+
- refactoring of CommentTextProcessor call
16+
- refactoring
17+
1318
__7.2.0 (13-jul-2025)__
1419

1520
- minimum JDK version 11
@@ -18,17 +23,6 @@ __7.2.0 (13-jul-2025)__
1823
- removed support of Gradle 5
1924
- updated dependencies
2025

21-
__7.1.2 (08-jun-2024)__
22-
23-
- added way to define a preprocessor extension class through CLI (as `/EA:<class.name>`) and in plugins (as `actionPreprocessorExtension`). The class should be provided in the clas path.[#48](https://github.com/raydac/java-comment-preprocessor/issues/48)
24-
- updated some dependencies
25-
26-
__7.1.1 (13-jan-2024)__
27-
28-
- fixed NPE for empty or null global variable value in Maven and
29-
Gradle [#47](https://github.com/raydac/java-comment-preprocessor/issues/47)
30-
- updated dependencies
31-
3226
[Full changelog](https://github.com/raydac/java-comment-preprocessor/blob/master/changelog.txt)
3327

3428
# Introduction
@@ -63,7 +57,7 @@ The preprocessor has been published in [the Maven Central](https://search.maven.
6357
<plugin>
6458
<groupId>com.igormaznitsa</groupId>
6559
<artifactId>jcp</artifactId>
66-
<version>7.1.2</version>
60+
<version>7.2.1</version>
6761
<executions>
6862
<execution>
6963
<id>preprocessSources</id>
@@ -82,13 +76,13 @@ The preprocessor has been published in [the Maven Central](https://search.maven.
8276
# How to use from command line
8377
The uber-jar can be started directly under Java through CLI interface. Let's take a look at short example below how to start it in command line under Linux:
8478
```
85-
java -jar jcp-7.2.0.jar --i:./test --o:./result
79+
java -jar jcp-7.2.1.jar --i:./test --o:./result
8680
```
8781
The example above just preprocessing files from ./test folder (which extensions allowed to be preprocessed by default), and placing result files into ./result folder. Keep in your mind that the preprocessor processing not all files, for instance XML files will not be preprocessed by default. Files which extension not marked for preprocessing will be just copied (of course if the extensions is not in the excluded extension list)
8882

8983
More complex example:
9084
```
91-
java -jar jcp-7.2.0.jar --c --r --v --f:java,xml --ef:none --i:./test --o:./result '--p:HelloWorld=$Hello world$'
85+
java -jar jcp-7.2.1.jar --c --r --v --f:java,xml --ef:none --i:./test --o:./result '--p:HelloWorld=$Hello world$'
9286
```
9387
- --c clear the destination folder before work
9488
- --r remove all Java-style comments from preprocessed result files
@@ -147,6 +141,6 @@ In opposite a regular document, a Java document has as minimum two sections - pr
147141
# How to remove all comments from sources
148142
Sometimes it is very useful to remove totally all comments from sources, such possibility included into JCP and can be activated with either a special flag or command line switcher. The example below shows how to remove all comments with CLI use:
149143
```
150-
java -jar ./jcp-7.2.0.jar --i:/sourceFolder --o:/resultFolder -ef:none --r
144+
java -jar ./jcp-7.2.1.jar --i:/sourceFolder --o:/resultFolder -ef:none --r
151145
```
152146

changelog.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
__7.2.1 (21-jul-2025)__
2+
3+
- refactoring of CommentTextProcessor call
4+
- refactoring
5+
16
__7.2.0 (13-jul-2025)__
7+
28
- minimum JDK version 11
39
- added support for external processors calls during uncommenting actions `//$` and `//$$`, processors can be provided as services
410
- removed support of Gradle 5

jcp-tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<packaging>pom</packaging>
99

1010
<properties>
11-
<jcp.test.version>7.2.1-SNAPSHOT</jcp.test.version>
11+
<jcp.test.version>7.2.1</jcp.test.version>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1313
<junit.version>5.13.3</junit.version>
1414
<maven.compiler.release>11</maven.compiler.release>

jcp/pom.xml

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.igormaznitsa</groupId>
77
<artifactId>jcp-pom</artifactId>
8-
<version>7.2.1-SNAPSHOT</version>
8+
<version>7.2.1</version>
99
</parent>
1010

1111
<artifactId>jcp</artifactId>
@@ -26,6 +26,62 @@
2626
</properties>
2727

2828
<profiles>
29+
<profile>
30+
<id>site</id>
31+
<properties>
32+
<mojo.site.dir>${project.basedir}/../mojo-doc-site</mojo.site.dir>
33+
</properties>
34+
<reporting>
35+
<plugins>
36+
<plugin>
37+
<groupId>org.apache.maven.plugins</groupId>
38+
<artifactId>maven-plugin-report-plugin</artifactId>
39+
</plugin>
40+
</plugins>
41+
</reporting>
42+
<build>
43+
<plugins>
44+
<plugin>
45+
<groupId>org.apache.maven.plugins</groupId>
46+
<artifactId>maven-clean-plugin</artifactId>
47+
<executions>
48+
<execution>
49+
<id>delete-project-site</id>
50+
<goals>
51+
<goal>clean</goal>
52+
</goals>
53+
<phase>clean</phase>
54+
<configuration>
55+
<excludeDefaultDirectories>true</excludeDefaultDirectories>
56+
<failOnError>true</failOnError>
57+
<filesets>
58+
<fileset>
59+
<directory>${mojo.site.dir}</directory>
60+
</fileset>
61+
</filesets>
62+
</configuration>
63+
</execution>
64+
</executions>
65+
</plugin>
66+
<plugin>
67+
<groupId>org.apache.maven.plugins</groupId>
68+
<artifactId>maven-site-plugin</artifactId>
69+
<executions>
70+
<execution>
71+
<id>generate-project-site</id>
72+
<goals>
73+
<goal>site</goal>
74+
</goals>
75+
<phase>verify</phase>
76+
<configuration>
77+
<outputDirectory>${mojo.site.dir}</outputDirectory>
78+
</configuration>
79+
</execution>
80+
</executions>
81+
</plugin>
82+
</plugins>
83+
</build>
84+
</profile>
2985
<profile>
3086
<id>publish</id>
3187
<build>
@@ -81,11 +137,6 @@
81137
<artifactId>extra-enforcer-rules</artifactId>
82138
<version>1.10.0</version>
83139
</dependency>
84-
<dependency>
85-
<groupId>org.apache.maven.shared</groupId>
86-
<artifactId>maven-dependency-tree</artifactId>
87-
<version>3.3.0</version>
88-
</dependency>
89140
</dependencies>
90141
</plugin>
91142

@@ -595,6 +646,7 @@
595646
<compilerArgument>-Xlint:all</compilerArgument>
596647
<showDeprecation>true</showDeprecation>
597648
<showWarnings>true</showWarnings>
649+
<release>${maven.compiler.release}</release>
598650
<excludes>
599651
<exclude>
600652
**${file.separator}JCPreprocessor${file.separator}src${file.separator}test${file.separator}resources${file.separator}com${file.separator}igormaznitsa${file.separator}jcp${file.separator}it${file.separator}maven${file.separator}dummy_maven_project${file.separator}**${file.separator}*.java
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Hello World
2+
3+
Just add the snippet into pom.xml
4+
5+
```xml
6+
7+
<build>
8+
<plugins>
9+
<plugin>
10+
<groupId>com.igormaznitsa</groupId>
11+
<artifactId>jcp</artifactId>
12+
<version>7.2.1</version>
13+
<executions>
14+
<execution>
15+
<id>preprocessSources</id>
16+
<phase>generate-sources</phase>
17+
<goals>
18+
<goal>preprocess</goal>
19+
</goals>
20+
</execution>
21+
</executions>
22+
</plugin>
23+
</plugins>
24+
</build>
25+
```
26+
27+
Then build project with `mvn clean install` and check the folder `target/generated-sources/preprocessed`

jcp/src/site/markdown/index.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Java Comment Preprocessor
2+
3+
Java Comment Preprocessor (JCP) is a Maven plugin that allows preprocessing of source code for languages that support
4+
C-style comments. It stores its directives inside comments and supports some automation features, such as loops and file
5+
loading/processing. JCP was originally created for developing mobile J2ME games, but later evolved into a full-featured
6+
tool.
7+
8+
Just add code-snippet below into build section and the plugin will be started during build.
9+
10+
```xml
11+
12+
<build>
13+
<plugins>
14+
<plugin>
15+
<groupId>com.igormaznitsa</groupId>
16+
<artifactId>jcp</artifactId>
17+
<version>7.2.1</version>
18+
<executions>
19+
<execution>
20+
<id>preprocess-sources</id>
21+
<phase>generate-sources</phase>
22+
<goals>
23+
<goal>preprocess</goal>
24+
</goals>
25+
</execution>
26+
</executions>
27+
</plugin>
28+
</plugins>
29+
</build>
30+
```

jcp/src/site/markdown/usage.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Usage
2+
3+
Just add the plugin into the module build section.
4+
5+
```xml
6+
7+
<plugin>
8+
<groupId>com.igormaznitsa</groupId>
9+
<artifactId>gosdk-wrapper-maven-plugin</artifactId>
10+
<version>1.0.5</version>
11+
<configuration>
12+
<goVersion>1.24.4</goVersion>
13+
</configuration>
14+
<executions>
15+
<execution>
16+
<id>go-help</id>
17+
<goals>
18+
<goal>execute</goal>
19+
</goals>
20+
<configuration>
21+
<args>
22+
<arg>help</arg>
23+
</args>
24+
</configuration>
25+
</execution>
26+
</executions>
27+
</plugin>
28+
```
29+
30+
If you use `jar` packaging then you should deactivate default plugin calls. You can disable
31+
them with below code snippet.
32+
33+
```xml
34+
35+
<plugin>
36+
<artifactId>maven-clean-plugin</artifactId>
37+
<executions>
38+
<execution>
39+
<id>default-clean</id>
40+
<phase>none</phase>
41+
</execution>
42+
</executions>
43+
</plugin>
44+
<plugin>
45+
<artifactId>maven-jar-plugin</artifactId>
46+
<executions>
47+
<execution>
48+
<id>default-jar</id>
49+
<phase>none</phase>
50+
</execution>
51+
</executions>
52+
</plugin>
53+
<plugin>
54+
<artifactId>maven-surefire-plugin</artifactId>
55+
<executions>
56+
<execution>
57+
<id>default-test</id>
58+
<phase>none</phase>
59+
</execution>
60+
</executions>
61+
</plugin>
62+
<plugin>
63+
<artifactId>maven-compiler-plugin</artifactId>
64+
<executions>
65+
<execution>
66+
<id>default-compile</id>
67+
<phase>none</phase>
68+
</execution>
69+
<execution>
70+
<id>default-testCompile</id>
71+
<phase>none</phase>
72+
</execution>
73+
</executions>
74+
</plugin>
75+
<plugin>
76+
<artifactId>maven-install-plugin</artifactId>
77+
<executions>
78+
<execution>
79+
<id>default-install</id>
80+
<phase>none</phase>
81+
</execution>
82+
</executions>
83+
</plugin>
84+
```

jcp/src/site/site.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project>
3+
<skin>
4+
<groupId>org.apache.maven.skins</groupId>
5+
<artifactId>maven-fluido-skin</artifactId>
6+
<version>2.0.1</version>
7+
</skin>
8+
<body>
9+
<menu name="Overview">
10+
<item name="Introduction" href="index.html"/>
11+
<item name="Goals" href="plugin-info.html"/>
12+
<item name="Usage" href="usage.html"/>
13+
<!-- <item name="FAQ" href="faq.html"/>-->
14+
</menu>
15+
<menu name="Examples">
16+
<item name="Hello World" href="examples/hello-world.html"/>
17+
</menu>
18+
</body>
19+
</project>

pom.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.igormaznitsa</groupId>
77
<artifactId>jcp-pom</artifactId>
8-
<version>7.2.1-SNAPSHOT</version>
8+
<version>7.2.1</version>
99
<packaging>pom</packaging>
1010

1111
<url>https://github.com/raydac/java-comment-preprocessor</url>
@@ -96,6 +96,16 @@
9696
<build>
9797
<pluginManagement>
9898
<plugins>
99+
<plugin>
100+
<groupId>org.apache.maven.plugins</groupId>
101+
<artifactId>maven-site-plugin</artifactId>
102+
<version>3.21.0</version>
103+
</plugin>
104+
<plugin>
105+
<groupId>org.apache.maven.plugins</groupId>
106+
<artifactId>maven-plugin-report-plugin</artifactId>
107+
<version>3.15.1</version>
108+
</plugin>
99109
<plugin>
100110
<groupId>org.apache.maven.plugins</groupId>
101111
<artifactId>maven-plugin-plugin</artifactId>

0 commit comments

Comments
 (0)