Skip to content

Commit fd442d6

Browse files
authored
Parser integration build main (#884)
* Spike/parser integration build (#882) * preparing pom.xml * preparing action * preparing pom.xml * Change visibility to private * Add JavaDoc * Add JavaDoc * Add JavaDoc and cleanup * Change public to private * Change public class to package-private * Add javadoc and rename event * Tweak and test ParserProperties * Restrict visibility * Tweak pom.xml * Changed pomCacheDirectory back to String * Changed pomCacheDirectory back to String * Fix integration build action * Fix javadoc * Fix profile name * Change branch name for dry-run * Delete build action for removed module * remove empty line * WIP: Trigger Integration Release * Remove blank line * WIP: Trigger Integration Release
1 parent c4b5c61 commit fd442d6

25 files changed

+576
-117
lines changed

.github/workflows/build-sbm-support-rewrite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build sbm-utils
1+
name: Build
22
on:
33
push:
44
branches:

.github/workflows/build-sbm-utils.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release Integration
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Build"]
6+
types: ["completed"]
7+
# branches: ["parser-integration-build-main"]
8+
9+
jobs:
10+
integration:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
16+
- name: Check out sources
17+
uses: actions/checkout@v3
18+
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v3
21+
with:
22+
distribution: 'temurin'
23+
java-version: 17
24+
cache: 'maven'
25+
26+
- name: Build with Maven
27+
env:
28+
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
29+
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
30+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
31+
working-directory: ./sbm-support-rewrite
32+
run: ./mvnw -B -Pspring-repos

sbm-support-rewrite/pom.xml

Lines changed: 211 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,77 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
53
<modelVersion>4.0.0</modelVersion>
64

7-
<groupId>org.springframework.sbm</groupId>
8-
<version>0.0.1-SNAPSHOT</version>
5+
<groupId>org.springframework.experimental</groupId>
6+
<version>0.1.0-SNAPSHOT</version>
97
<artifactId>sbm-support-rewrite</artifactId>
108

9+
<name>Spring Boot Migrator OpenRewrite Support</name>
10+
<description>Parse projects and run OpenRewrite recipes without build tool plugin</description>
11+
<url>https://github.com/spring-projects-experimental/spring-boot-migrator/sbm-support-rewrite</url>
12+
13+
<organization>
14+
<name>VMware Inc.</name>
15+
<url>https://spring.io</url>
16+
</organization>
17+
1118
<properties>
1219
<maven.compiler.source>17</maven.compiler.source>
1320
<maven.compiler.target>17</maven.compiler.target>
1421
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1522
<spring-boot.version>3.1.1</spring-boot.version>
1623
<rewrite.version>8.1.6</rewrite.version>
17-
<rewrite-maven-plugin.version>5.3.2</rewrite-maven-plugin.version>
1824
<rewrite-spring.version>5.0.5</rewrite-spring.version>
19-
<sbm.version>0.15.0-SNAPSHOT</sbm.version>
25+
<rewrite-maven-plugin.version>5.3.2</rewrite-maven-plugin.version>
2026
<maven.version>3.9.1</maven.version>
2127
<maven-resolver.version>1.9.7</maven-resolver.version>
2228
<maven-wagon-http.version>3.5.3</maven-wagon-http.version>
2329
</properties>
2430

31+
<developers>
32+
<developer>
33+
<id>fkrueger</id>
34+
<name>Fabian Krüger</name>
35+
<email>fkrueger at vmware.com</email>
36+
<organization>VMware</organization>
37+
<organizationUrl>http://www.spring.io</organizationUrl>
38+
<roles>
39+
<role>lead</role>
40+
</roles>
41+
</developer>
42+
</developers>
43+
2544
<scm>
2645
<developerConnection>scm:git:https://github.com/spring-projects-experimental/spring-boot-migrator.git</developerConnection>
2746
<connection>scm:git:https://github.com/spring-projects-experimental/spring-boot-migrator</connection>
2847
<url>https://github.com/spring-projects-experimental/spring-boot-migrator/sbm-support-openrewrite</url>
29-
<tag>0.0.1-SNAPSHOT</tag>
48+
<tag>0.1.0-SNAPSHOT</tag>
3049
</scm>
3150

32-
<repositories>
33-
<repository>
34-
<id>jcenter</id>
35-
<name>jcenter</name>
36-
<url>https://jcenter.bintray.com</url>
37-
</repository>
38-
<repository>
39-
<id>mavencentral</id>
40-
<name>mavencentral</name>
41-
<url>https://repo.maven.apache.org/maven2</url>
42-
</repository>
43-
</repositories>
51+
<licenses>
52+
<license>
53+
<name>Apache License, Version 2.0</name>
54+
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
55+
<comments>
56+
Copyright 2022-2023 the original author or authors.
57+
58+
Licensed under the Apache License, Version 2.0 (the "License");
59+
you may not use this file except in compliance with the License.
60+
You may obtain a copy of the License at
61+
62+
https://www.apache.org/licenses/LICENSE-2.0
63+
64+
Unless required by applicable law or agreed to in writing, software
65+
distributed under the License is distributed on an "AS IS" BASIS,
66+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
67+
implied.
68+
69+
See the License for the specific language governing permissions and
70+
limitations under the License.
71+
</comments>
72+
</license>
73+
</licenses>
74+
4475
<dependencyManagement>
4576
<dependencies>
4677
<dependency>
@@ -111,7 +142,6 @@
111142
<artifactId>lombok</artifactId>
112143
<scope>provided</scope>
113144
</dependency>
114-
115145
<dependency>
116146
<groupId>org.apache.maven.wagon</groupId>
117147
<artifactId>wagon-http</artifactId>
@@ -153,7 +183,6 @@
153183
</exclusion>
154184
</exclusions>
155185
</dependency>
156-
157186
<dependency>
158187
<groupId>org.codehaus.plexus</groupId>
159188
<artifactId>plexus-cipher</artifactId>
@@ -180,19 +209,39 @@
180209
<version>2.3.1</version>
181210
</dependency>
182211
<dependency>
183-
<groupId>org.junit-pioneer</groupId>
184-
<artifactId>junit-pioneer</artifactId>
185-
<version>2.0.1</version>
212+
<groupId>org.springframework.boot</groupId>
213+
<artifactId>spring-boot-starter-test</artifactId>
186214
<scope>test</scope>
187215
</dependency>
188216
<dependency>
189-
<groupId>org.springframework.boot</groupId>
190-
<artifactId>spring-boot-starter-test</artifactId>
217+
<groupId>org.junit-pioneer</groupId>
218+
<artifactId>junit-pioneer</artifactId>
219+
<version>2.0.1</version>
191220
<scope>test</scope>
192221
</dependency>
193222
</dependencies>
194223

195224
<build>
225+
<pluginManagement>
226+
<plugins>
227+
<plugin>
228+
<groupId>org.apache.maven.plugins</groupId>
229+
<artifactId>maven-javadoc-plugin</artifactId>
230+
<version>3.4.1</version>
231+
<configuration>
232+
<doclint>accessibility,html,reference,syntax</doclint>
233+
<show>package</show>
234+
<quiet>true</quiet>
235+
<level>public</level>
236+
<fixTags>author</fixTags>
237+
<fixClassComment>true</fixClassComment>
238+
<fixFieldComment>false</fixFieldComment>
239+
<fixMethodComment>false</fixMethodComment>
240+
</configuration>
241+
</plugin>
242+
</plugins>
243+
</pluginManagement>
244+
196245
<plugins>
197246
<plugin>
198247
<groupId>org.springframework.boot</groupId>
@@ -296,7 +345,141 @@ limitations under the License.
296345
</licenseSets>
297346
</configuration>
298347
</plugin>
348+
349+
<!-- <plugin>-->
350+
<!-- <groupId>org.apache.maven.plugins</groupId>-->
351+
<!-- <artifactId>maven-surefire-plugin</artifactId>-->
352+
<!-- <version>3.1.2</version>-->
353+
<!-- <configuration>-->
354+
<!-- <excludes>-->
355+
<!-- <exclude />-->
356+
<!-- </excludes>-->
357+
<!-- </configuration>-->
358+
<!-- </plugin>-->
359+
360+
<plugin>
361+
<groupId>org.apache.maven.plugins</groupId>
362+
<artifactId>maven-source-plugin</artifactId>
363+
<version>3.3.0</version>
364+
<executions>
365+
<execution>
366+
<id>attach-sources</id>
367+
<goals>
368+
<goal>jar</goal>
369+
</goals>
370+
</execution>
371+
</executions>
372+
</plugin>
373+
374+
<plugin>
375+
<groupId>org.apache.maven.plugins</groupId>
376+
<artifactId>maven-jar-plugin</artifactId>
377+
<version>3.3.0</version>
378+
<!-- <configuration>-->
379+
<!-- <archive>-->
380+
<!-- <manifestEntries>-->
381+
<!-- <Implementation-Title>${project.name}</Implementation-Title>-->
382+
<!-- <Implementation-Version>${project.version}</Implementation-Version>-->
383+
<!-- <Automatic-Module-Name>org.springframework.sbm.rewrite</Automatic-Module-Name>-->
384+
<!-- </manifestEntries>-->
385+
<!-- </archive>-->
386+
<!-- </configuration>-->
387+
</plugin>
388+
389+
<plugin>
390+
<groupId>org.codehaus.mojo</groupId>
391+
<artifactId>flatten-maven-plugin</artifactId>
392+
<version>1.4.1</version>
393+
<executions>
394+
<execution>
395+
<id>flatten</id>
396+
<phase>process-resources</phase>
397+
<goals>
398+
<goal>flatten</goal>
399+
</goals>
400+
<configuration>
401+
<updatePomFile>true</updatePomFile>
402+
<flattenMode>oss</flattenMode>
403+
<pomElements>
404+
<distributionManagement>remove</distributionManagement>
405+
<properties>remove</properties>
406+
<repositories>remove</repositories>
407+
<profiles>remove</profiles>
408+
</pomElements>
409+
</configuration>
410+
</execution>
411+
<execution>
412+
<id>flatten-clean</id>
413+
<phase>clean</phase>
414+
<goals>
415+
<goal>clean</goal>
416+
</goals>
417+
</execution>
418+
</executions>
419+
</plugin>
420+
<plugin>
421+
<groupId>org.apache.maven.plugins</groupId>
422+
<artifactId>maven-release-plugin</artifactId>
423+
<version>3.0.0</version>
424+
<configuration>
425+
<releaseProfiles>sonatype</releaseProfiles>
426+
<!-- <autoVersionSubmodules>true</autoVersionSubmodules>-->
427+
<pushChanges>false</pushChanges>
428+
<tagNameFormat>@{project.version}</tagNameFormat>
429+
<localCheckout>true</localCheckout>
430+
</configuration>
431+
</plugin>
299432
</plugins>
300433
</build>
301-
434+
<profiles>
435+
<profile>
436+
<id>ci</id>
437+
<build>
438+
<plugins>
439+
<plugin>
440+
<groupId>org.apache.maven.plugins</groupId>
441+
<artifactId>maven-javadoc-plugin</artifactId>
442+
<version>3.4.1</version>
443+
<executions>
444+
<execution>
445+
<id>attach-javadocs</id>
446+
<goals>
447+
<goal>jar</goal>
448+
</goals>
449+
</execution>
450+
</executions>
451+
</plugin>
452+
</plugins>
453+
</build>
454+
</profile>
455+
<profile>
456+
<id>spring-repos</id>
457+
<repositories>
458+
<repository>
459+
<id>spring-snapshots</id>
460+
<name>Spring Snapshots</name>
461+
<url>https://repo.spring.io/libs-snapshot-local</url>
462+
<snapshots>
463+
<enabled>true</enabled>
464+
</snapshots>
465+
</repository>
466+
<repository>
467+
<id>spring-milestones</id>
468+
<name>Spring Milestones</name>
469+
<url>https://repo.spring.io/libs-milestone-local</url>
470+
<snapshots>
471+
<enabled>false</enabled>
472+
</snapshots>
473+
</repository>
474+
<repository>
475+
<id>spring-releases</id>
476+
<name>Spring Releases</name>
477+
<url>https://repo.spring.io/release</url>
478+
<snapshots>
479+
<enabled>false</enabled>
480+
</snapshots>
481+
</repository>
482+
</repositories>
483+
</profile>
484+
</profiles>
302485
</project>

sbm-support-rewrite/src/main/java/org/springframework/sbm/RewriteParserConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import java.util.List;
3434

3535
/**
36+
* Module configuration.
37+
*
3638
* @author Fabian Krüger
3739
*/
3840
@SpringBootApplication

sbm-support-rewrite/src/main/java/org/springframework/sbm/parsers/BuildFileParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ class BuildFileParser {
5454
private final ParserSettings parserSettings;
5555

5656
/**
57-
* Parse a list of Maven Pom files to a Map of {@code Path} and their parsed {@Xml.Document}s.
57+
* Parse a list of Maven Pom files to a Map of {@code Path} and their parsed {@link Xml.Document}s.
5858
* The {@link Xml.Document}s are marked with {@link org.openrewrite.maven.tree.MavenResolutionResult} and the provided provenance markers.
5959
* Reimplements {@link org.openrewrite.maven.MavenMojoProjectParser#parseMaven(List, Map, ExecutionContext)}.
6060
*
6161
* @param baseDir the {@link Path} to the root of the scanned project
6262
* @param buildFiles the list of resources for relevant pom files.
6363
* @param activeProfiles teh active Maven profiles
6464
* @param executionContext the ExecutionContext to use
65+
* * @param skipMavenParsing skip parsing Maven files
6566
* @param provenanceMarkers the map of markers to be added
66-
* @param
6767
*/
6868
public Map<Path, Xml.Document> parseBuildFiles(
6969
Path baseDir,

0 commit comments

Comments
 (0)