Skip to content

Commit

Permalink
Parser integration build main (#884)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
fabapp2 authored Aug 26, 2023
1 parent c4b5c61 commit fd442d6
Show file tree
Hide file tree
Showing 25 changed files with 576 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-sbm-support-rewrite.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build sbm-utils
name: Build
on:
push:
branches:
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/build-sbm-utils.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/release-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release Integration

on:
workflow_run:
workflows: ["Build"]
types: ["completed"]
# branches: ["parser-integration-build-main"]

jobs:
integration:
name: Build
runs-on: ubuntu-latest

steps:

- name: Check out sources
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'

- name: Build with Maven
env:
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
working-directory: ./sbm-support-rewrite
run: ./mvnw -B -Pspring-repos
239 changes: 211 additions & 28 deletions sbm-support-rewrite/pom.xml
Original file line number Diff line number Diff line change
@@ -1,46 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<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">
<modelVersion>4.0.0</modelVersion>

<groupId>org.springframework.sbm</groupId>
<version>0.0.1-SNAPSHOT</version>
<groupId>org.springframework.experimental</groupId>
<version>0.1.0-SNAPSHOT</version>
<artifactId>sbm-support-rewrite</artifactId>

<name>Spring Boot Migrator OpenRewrite Support</name>
<description>Parse projects and run OpenRewrite recipes without build tool plugin</description>
<url>https://github.com/spring-projects-experimental/spring-boot-migrator/sbm-support-rewrite</url>

<organization>
<name>VMware Inc.</name>
<url>https://spring.io</url>
</organization>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-boot.version>3.1.1</spring-boot.version>
<rewrite.version>8.1.6</rewrite.version>
<rewrite-maven-plugin.version>5.3.2</rewrite-maven-plugin.version>
<rewrite-spring.version>5.0.5</rewrite-spring.version>
<sbm.version>0.15.0-SNAPSHOT</sbm.version>
<rewrite-maven-plugin.version>5.3.2</rewrite-maven-plugin.version>
<maven.version>3.9.1</maven.version>
<maven-resolver.version>1.9.7</maven-resolver.version>
<maven-wagon-http.version>3.5.3</maven-wagon-http.version>
</properties>

<developers>
<developer>
<id>fkrueger</id>
<name>Fabian Krüger</name>
<email>fkrueger at vmware.com</email>
<organization>VMware</organization>
<organizationUrl>http://www.spring.io</organizationUrl>
<roles>
<role>lead</role>
</roles>
</developer>
</developers>

<scm>
<developerConnection>scm:git:https://github.com/spring-projects-experimental/spring-boot-migrator.git</developerConnection>
<connection>scm:git:https://github.com/spring-projects-experimental/spring-boot-migrator</connection>
<url>https://github.com/spring-projects-experimental/spring-boot-migrator/sbm-support-openrewrite</url>
<tag>0.0.1-SNAPSHOT</tag>
<tag>0.1.0-SNAPSHOT</tag>
</scm>

<repositories>
<repository>
<id>jcenter</id>
<name>jcenter</name>
<url>https://jcenter.bintray.com</url>
</repository>
<repository>
<id>mavencentral</id>
<name>mavencentral</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
<comments>
Copyright 2022-2023 the original author or authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.

See the License for the specific language governing permissions and
limitations under the License.
</comments>
</license>
</licenses>

<dependencyManagement>
<dependencies>
<dependency>
Expand Down Expand Up @@ -111,7 +142,6 @@
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
Expand Down Expand Up @@ -153,7 +183,6 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-cipher</artifactId>
Expand All @@ -180,19 +209,39 @@
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.junit-pioneer</groupId>
<artifactId>junit-pioneer</artifactId>
<version>2.0.1</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<groupId>org.junit-pioneer</groupId>
<artifactId>junit-pioneer</artifactId>
<version>2.0.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<configuration>
<doclint>accessibility,html,reference,syntax</doclint>
<show>package</show>
<quiet>true</quiet>
<level>public</level>
<fixTags>author</fixTags>
<fixClassComment>true</fixClassComment>
<fixFieldComment>false</fixFieldComment>
<fixMethodComment>false</fixMethodComment>
</configuration>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -296,7 +345,141 @@ limitations under the License.
</licenseSets>
</configuration>
</plugin>

<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-surefire-plugin</artifactId>-->
<!-- <version>3.1.2</version>-->
<!-- <configuration>-->
<!-- <excludes>-->
<!-- <exclude />-->
<!-- </excludes>-->
<!-- </configuration>-->
<!-- </plugin>-->

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<!-- <configuration>-->
<!-- <archive>-->
<!-- <manifestEntries>-->
<!-- <Implementation-Title>${project.name}</Implementation-Title>-->
<!-- <Implementation-Version>${project.version}</Implementation-Version>-->
<!-- <Automatic-Module-Name>org.springframework.sbm.rewrite</Automatic-Module-Name>-->
<!-- </manifestEntries>-->
<!-- </archive>-->
<!-- </configuration>-->
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>oss</flattenMode>
<pomElements>
<distributionManagement>remove</distributionManagement>
<properties>remove</properties>
<repositories>remove</repositories>
<profiles>remove</profiles>
</pomElements>
</configuration>
</execution>
<execution>
<id>flatten-clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<releaseProfiles>sonatype</releaseProfiles>
<!-- <autoVersionSubmodules>true</autoVersionSubmodules>-->
<pushChanges>false</pushChanges>
<tagNameFormat>@{project.version}</tagNameFormat>
<localCheckout>true</localCheckout>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>ci</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>spring-repos</id>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import java.util.List;

/**
* Module configuration.
*
* @author Fabian Krüger
*/
@SpringBootApplication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ class BuildFileParser {
private final ParserSettings parserSettings;

/**
* Parse a list of Maven Pom files to a Map of {@code Path} and their parsed {@Xml.Document}s.
* Parse a list of Maven Pom files to a Map of {@code Path} and their parsed {@link Xml.Document}s.
* The {@link Xml.Document}s are marked with {@link org.openrewrite.maven.tree.MavenResolutionResult} and the provided provenance markers.
* Reimplements {@link org.openrewrite.maven.MavenMojoProjectParser#parseMaven(List, Map, ExecutionContext)}.
*
* @param baseDir the {@link Path} to the root of the scanned project
* @param buildFiles the list of resources for relevant pom files.
* @param activeProfiles teh active Maven profiles
* @param executionContext the ExecutionContext to use
* * @param skipMavenParsing skip parsing Maven files
* @param provenanceMarkers the map of markers to be added
* @param
*/
public Map<Path, Xml.Document> parseBuildFiles(
Path baseDir,
Expand Down
Loading

0 comments on commit fd442d6

Please sign in to comment.