Skip to content

Commit 2cde5fd

Browse files
authored
change to groovy to groupId org.apache.groovy and bump version to 4.0.6 (#154)
Signed-off-by: Olivier Lamy <[email protected]>
1 parent d8a4871 commit 2cde5fd

File tree

14 files changed

+68
-44
lines changed

14 files changed

+68
-44
lines changed

.github/workflows/maven-verify.yml

+5
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ jobs:
2525
build:
2626
name: Verify
2727
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v3
28+
with:
29+
maven-args: '-D"invoker.streamLogsOnFailures" -U'
30+
# put this back when 3.4.0 with jdk19 support has been released
31+
#jdk-matrix: '[ "8", "11", "17", "19"]'
32+
# verify-fail-fast: false

Jenkinsfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
* under the License.
1818
*/
1919

20-
asfMavenTlpPlgnBuild()
20+
// put 19 back when 3.4.0 with jdk19 support has been released
21+
asfMavenTlpPlgnBuild(jdks:[ "8", "11", "17"])

pom.xml

+36-18
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ under the License.
3030
</parent>
3131

3232
<artifactId>maven-invoker-plugin</artifactId>
33-
<version>3.3.1-SNAPSHOT</version>
33+
<version>3.4.0-SNAPSHOT</version>
3434
<packaging>maven-plugin</packaging>
3535

3636
<name>Apache Maven Invoker Plugin</name>
@@ -70,9 +70,8 @@ under the License.
7070
<beanshell-groupId>org.apache-extras.beanshell</beanshell-groupId>
7171
<beanshell-artifactId>bsh</beanshell-artifactId>
7272
<beanshell-version>2.0b6</beanshell-version>
73-
<groovy-groupId>org.codehaus.groovy</groovy-groupId>
74-
<groovy-version>3.0.12</groovy-version>
7573
<project.build.outputTimestamp>2022-05-25T15:26:55Z</project.build.outputTimestamp>
74+
<groovy-version>4.0.6</groovy-version>
7675
</properties>
7776

7877
<dependencyManagement>
@@ -98,6 +97,13 @@ under the License.
9897
<artifactId>commons-io</artifactId>
9998
<version>2.11.0</version>
10099
</dependency>
100+
<dependency>
101+
<groupId>org.apache.groovy</groupId>
102+
<artifactId>groovy-bom</artifactId>
103+
<version>${groovy-version}</version>
104+
<type>pom</type>
105+
<scope>import</scope>
106+
</dependency>
101107
</dependencies>
102108
</dependencyManagement>
103109

@@ -159,14 +165,7 @@ under the License.
159165
<dependency>
160166
<groupId>org.apache.maven.shared</groupId>
161167
<artifactId>maven-script-interpreter</artifactId>
162-
<version>1.3</version>
163-
<exclusions>
164-
<!-- there's already a direct dependency to groovy -->
165-
<exclusion>
166-
<groupId>org.codehaus.groovy</groupId>
167-
<artifactId>groovy</artifactId>
168-
</exclusion>
169-
</exclusions>
168+
<version>1.4-SNAPSHOT</version>
170169
</dependency>
171170

172171
<dependency>
@@ -189,21 +188,18 @@ under the License.
189188
</dependency>
190189

191190
<dependency>
192-
<groupId>${groovy-groupId}</groupId>
191+
<groupId>org.apache.groovy</groupId>
193192
<artifactId>groovy</artifactId>
194-
<version>${groovy-version}</version>
195193
<scope>runtime</scope>
196194
</dependency>
197195
<dependency>
198-
<groupId>${groovy-groupId}</groupId>
196+
<groupId>org.apache.groovy</groupId>
199197
<artifactId>groovy-json</artifactId>
200-
<version>${groovy-version}</version>
201198
<scope>runtime</scope>
202199
</dependency>
203200
<dependency>
204-
<groupId>${groovy-groupId}</groupId>
201+
<groupId>org.apache.groovy</groupId>
205202
<artifactId>groovy-xml</artifactId>
206-
<version>${groovy-version}</version>
207203
<scope>runtime</scope>
208204
</dependency>
209205

@@ -265,7 +261,6 @@ under the License.
265261
<version>1.7.36</version>
266262
<scope>test</scope>
267263
</dependency>
268-
269264
</dependencies>
270265

271266
<build>
@@ -332,6 +327,29 @@ under the License.
332327
<version>1.0.0</version>
333328
</configuration>
334329
</plugin>
330+
<plugin>
331+
<groupId>org.apache.maven.plugins</groupId>
332+
<artifactId>maven-enforcer-plugin</artifactId>
333+
<executions>
334+
<execution>
335+
<id>ban-org-codehaus-groovy</id>
336+
<goals>
337+
<goal>enforce</goal>
338+
</goals>
339+
<phase>validate</phase>
340+
<configuration>
341+
<rules>
342+
<bannedDependencies>
343+
<excludes>
344+
<exclude>org.codehaus.groovy:*</exclude>
345+
</excludes>
346+
<searchTransitive>true</searchTransitive>
347+
</bannedDependencies>
348+
</rules>
349+
</configuration>
350+
</execution>
351+
</executions>
352+
</plugin>
335353
</plugins>
336354
</build>
337355

src/it/MINVOKER-196_junit_report_file/src/it/project/verify.groovy

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* under the License.
1818
*/
1919

20+
import groovy.xml.XmlSlurper
21+
2022
// ensure script context contains localRepositoryPath
2123
assert new File( basedir, "../../../target/it-repo" ).canonicalFile.equals( localRepositoryPath )
2224

src/it/MINVOKER-196_junit_report_file/verify.groovy

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
import groovy.xml.XmlSlurper
20+
1921
File buildLog = new File( basedir, 'build.log' )
2022
assert buildLog.text.contains( '[INFO] run post-build script verify.groovy' )
2123

src/it/MINVOKER-288-failed-setup-run/verify.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
19+
import groovy.xml.XmlSlurper
2020

2121
File invokerReports = new File( new File(basedir, 'target'), 'invoker-reports-test' )
2222
assert invokerReports.exists()

src/it/MINVOKER-288-failed-setup-verify/verify.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
19+
import groovy.xml.XmlSlurper
2020

2121
File invokerReports = new File( new File(basedir, "target"), 'invoker-reports-test' )
2222
assert invokerReports.exists()

src/it/local-repo-url/src/it/project/postbuild.groovy

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* under the License.
1818
*/
1919

20+
import groovy.xml.XmlSlurper
21+
2022
// ensure script context contains localRepositoryPath
2123
assert new File( basedir, "../../../target/it-repo" ).canonicalFile.equals( localRepositoryPath )
2224

src/it/script-classpath-duplicates/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ under the License.
4141
<scope>test</scope>
4242
</dependency>
4343
<dependency>
44-
<groupId>@groovy-groupId@</groupId>
44+
<groupId>org.apache.groovy</groupId>
4545
<artifactId>groovy</artifactId>
4646
<version>@groovy-version@</version>
4747
<type>pom</type>

src/it/script-streamLogs-false/verify.groovy

+2-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ assert beanshellLog.contains('java.lang.OutOfMemoryError: Requested array size e
4040

4141
// groovy failed and no log message
4242
assert !buildLog.contains('[INFO] Output from groovy script')
43-
assert !buildLog.contains('Assertion failed:')
44-
assert !buildLog.contains('assert pom.contains("<modelVersion>9.9.9</modelVersion>")')
45-
assert buildLog.contains('[INFO] org.apache.maven.shared.scriptinterpreter.ScriptEvaluationException: Assertion Error')
43+
assert buildLog.contains('Assertion failed:')
44+
assert buildLog.contains('assert pom.contains("<modelVersion>9.9.9</modelVersion>")')
4645
assert buildLog.contains('[INFO] groovy' + FS + 'pom.xml ................................... FAILED')
4746

4847
assert groovyLog.contains('Output from groovy script')

src/it/script-verify-xml/verify.groovy

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* under the License.
1818
*/
1919

20+
import groovy.xml.XmlSlurper
21+
2022
// from http://groovy-lang.org/processing-xml.html
2123
// A lot of examples covering xml assertions
2224

src/it/selector-scripts/setup.groovy

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
* under the License.
1818
*/
1919

20-
import org.apache.commons.io.FileUtils
20+
import java.io.File
2121

2222
// Previous potential target 'content' has impact on IT execution
2323
// (Some new file should be created by verify.sh)
24-
FileUtils.deleteQuietly( new File( basedir, "target/invoker-reports-test" ) );
25-
FileUtils.deleteQuietly( new File( basedir, "src/it/script-ret-quiet/target" ) );
26-
FileUtils.deleteQuietly( new File( basedir, "src/it/script-ret-true/target" ) );
24+
new File( basedir, "target/invoker-reports-test" ).deleteDir()
25+
new File( basedir, "src/it/script-ret-quiet/target" ).deleteDir()
26+
new File( basedir, "src/it/script-ret-true/target" ).deleteDir()
2727
return true;

src/it/settings-merge_jdk9+/src/it/project/postbuild.groovy

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* under the License.
1818
*/
1919

20+
import groovy.xml.XmlSlurper
21+
2022
File effectiveSettings = new File( basedir, "effective-settings.xml" )
2123
assert effectiveSettings.isFile()
2224

src/site/apt/groovy-version.apt.vm

+6-15
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ Groovy version and extensions
3131
<<NOTICE>>: Plugin <<<maven-invoker-plugin>>> in versions older than <<<3.3.0>>> has dependency
3232
on <<<groovy-all>>> artifact from <<<Groovy 2>>>.
3333

34-
Plugin <<<maven-invoker-plugin>>> in version <<<3.3.0>>> has only dependency on <<<Groovy 3>>> core add common extensions:
34+
Plugin <<<maven-invoker-plugin>>> in version <<<3.4.0>>> has only dependency on <<<Groovy 4>>> core add common extensions:
3535

36-
* <<<org.codehaus.groovy:groovy:3.0.10>>>
36+
* <<<org.apache.groovy:groovy:${groovy-version}>>>
3737

38-
* <<<org.codehaus.groovy:groovy-json:3.0.10>>>
38+
* <<<org.apache.groovy:groovy-json:${groovy-version}>>>
3939

40-
* <<<org.codehaus.groovy:groovy-xml:3.0.10>>>
40+
* <<<org.apache.groovy:groovy-xml:${groovy-version}>>>
4141

4242
[]
4343

@@ -54,7 +54,7 @@ Groovy version and extensions
5454
.....
5555
<dependencies>
5656
<dependency>
57-
<groupId>org.codehaus.groovy</groupId>
57+
<groupId>org.apache.groovy</groupId>
5858
<artifactId>groovy-yaml</artifactId>
5959
<version>3.0.10</version>
6060
</dependency>
@@ -65,14 +65,5 @@ Groovy version and extensions
6565
</project>
6666
+------------------
6767

68-
<<NOTICE>>: In plugin version <<<3.3.0>>> only <<<Groovy 3>>> extensions can be used.
68+
<<NOTICE>>: In plugin version <<<3.3.0>>> only <<<Groovy 4>>> extensions can be used.
6969

70-
Groovy 4
71-
72-
Please be noted that in <<<Groovy 4>>> maven <<<groupId>>> was changed
73-
from <<org.codehaus.groovy>> to <<org.apache.groovy>>.
74-
75-
Plugin has dependency on <<<Groovy 3>>> artifacts with old <<<groupId>>>,
76-
what causes that <<<Groovy 4>>> can not by used in scripts.
77-
78-
Next version of <<<maven-invoker-plugin>>> can contains <<<Groovy 4>>> as default.

0 commit comments

Comments
 (0)