Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update apps generator plugin dependencies #593

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

onobc
Copy link
Collaborator

@onobc onobc commented Dec 10, 2024

This commit updates all library and plugin dependencies in the spring-cloud-dataflow-apps-plugin modules to the latest versions.

Additionally:

  • performs a general cleanup of build and README files.
  • updates to maven 3.9.9

Resolves #498

This commit updates all library and plugin dependencies
in the `spring-cloud-dataflow-apps-plugin` modules to
the latest versions.

Additionally:
- performs a general cleanup of build and README files.
- updates to maven 3.9.9

Resolves spring-cloud#498
@onobc onobc added the dependencies Pull requests that update a dependency file label Dec 10, 2024
@onobc onobc requested review from corneil and artembilan December 10, 2024 04:21
@@ -1,2 +1,20 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
# Licensed to the Apache Software Foundation (ASF) under one
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the wrapper and maven to 3.9.9

@@ -3,41 +3,44 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-apps-plugin-parent</artifactId>
<version>1.0.15-SNAPSHOT</version>
<version>1.1.0-SNAPSHOT</version>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping up minor version to indicate the dependency updates

@@ -418,14 +418,14 @@ public Manifest getManifest() {
}

@Override
public List<Archive> getNestedArchives(EntryFilter ignored) throws IOException {
public Iterator<Archive> getNestedArchives(EntryFilter ignored, EntryFilter ignored2) throws IOException {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API change in Maven

String result = writer.toString();
return result.substring(result.indexOf('\n') + 1); // remove first line (e.g. remove the <?xml ... ?>)
// Strip the namespace info
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest version of MXSerializer handles generated xml a bit different. This impl has been improved to look for the actual tag, not the 1st newline character for parsing.

@@ -168,6 +173,9 @@ public static <T> void invokeMavenXppWriteMethod(T modelElementToWrite, String w
public static String indent(String input, int indentation) {
String indentPrefix = "\n" + IntStream.range(0, indentation).mapToObj(i -> " ").collect(Collectors.joining());
String indentedInput = input.replace("\n", indentPrefix);
return indentedInput.substring(0, indentedInput.lastIndexOf(indentPrefix)); // remove the last empty line.
if (input.endsWith(indentPrefix)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to comment above, more lenient processing.

void httpSourceAppsGeneration() throws Exception {
File pomRoot = new File("src/test/resources/unit/http-source-apps");
MavenProject project = readMavenProject(pomRoot);
SpringCloudStreamAppGeneratorMojo myMojo = (SpringCloudStreamAppGeneratorMojo) super.lookupConfiguredMojo(project, "generate-app");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no Junit5 replacement for the Mojo Junit5 rule. HOWEVER, the AbstractMojoTestCase has what we need but we have to jump through some hoops in readMavenProject to get an actual project object to then pass into super.lookupConfiguredMojo.

<version>3.15.0</version>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-configuration-metadata</artifactId>
<version>2.11.5</version>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is way less than ideal. However, it was previously hardcoded to 2.7.0 so just updated to 2.11.5 for now. Need to figure out how to detangle this bidrectional dependency (apps plugin needs SCDF and SCDF needs apps plugin).

Copy link
Collaborator

@artembilan artembilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot tell that I understood too much from the change, but mostly it is really OK.
Just a couple nit-picks from me.

Thanks

@@ -1,5 +1,5 @@
/*
* Copyright 2019-2020 the original author or authors.
* Copyright 2019-2024 the original author or authors.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like these couple classes updates are bogus.
What do I miss?
Why would one update just a copyright year?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically I would not just update the copyright like this but I was basically brining this repo up-to-date for everything I could find that was outdated. I figured I would catch up the copyrights as well.

<version>2.0.0.BUILD-SNAPSHOT</version>

<artifactId>spring-cloud-dataflow-apps-metadata-plugin</artifactId>
<version>1.0.0</version>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really expected to have 1.0.0 here as a version, but not the mentioned above 1.1.0-SNAPSHOT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Will update

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2020 the original author or authors.
* Copyright 2017-2024 the original author or authors.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DITTO - bogus.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,5 +1,5 @@
/*
* Copyright 2018-2020 the original author or authors.
* Copyright 2018-2024 the original author or authors.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And again 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- Use `1.1.0-SNAPSHOT` as version in metadata plugin README.adoc
  to be consistent w/ other examples
@onobc onobc requested a review from artembilan December 10, 2024 17:59
@artembilan artembilan merged commit 4376848 into spring-cloud:main Dec 10, 2024
2 checks passed
@artembilan
Copy link
Collaborator

I have no idea what is that CI build failure:

[Info] Cleaning build info...
[Info] Cleaned build info spring-cloud-dataflow-apps-plugin-main-snapshot/22.
[Info] Running Mvn...
[Info] The build-info-extractor jar is not cached locally. Downloading it now...
 You can set the repository from which this jar is downloaded. Read more about it at https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-DownloadingtheMavenandGradleExtractorJARs
[Info] Downloading build-info-extractor from https://oss.jfrog.org/artifactory/oss-release-local/org/jfrog/buildinfo/build-info-extractor-maven3/2.25.0/build-info-extractor-maven3-2.25.0-uber.jar
Error:  Server ID 'repo.spring.io' does not exist.
Error: Process completed with exit code 1.

@onobc
Copy link
Collaborator Author

onobc commented Dec 10, 2024

I have no idea what is that CI build failure:

[Info] Cleaning build info...
[Info] Cleaned build info spring-cloud-dataflow-apps-plugin-main-snapshot/22.
[Info] Running Mvn...
[Info] The build-info-extractor jar is not cached locally. Downloading it now...
 You can set the repository from which this jar is downloaded. Read more about it at https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-DownloadingtheMavenandGradleExtractorJARs
[Info] Downloading build-info-extractor from https://oss.jfrog.org/artifactory/oss-release-local/org/jfrog/buildinfo/build-info-extractor-maven3/2.25.0/build-info-extractor-maven3-2.25.0-uber.jar
Error:  Server ID 'repo.spring.io' does not exist.
Error: Process completed with exit code 1.

Digging in..

@onobc onobc deleted the GH-498-update-apps-plugin-deps branch December 10, 2024 21:11
@onobc
Copy link
Collaborator Author

onobc commented Dec 10, 2024

@artembilan this 5cce183#diff-56d907718f7f9fbb26e09bddd3723c4ba7782bf2eaf3b8f22781f2a66df9701bR43 fixed it

Something has changed on Artifactory where the server id used to generate the token was "repo.spring.io" but is now different per group of projects (e.g. it is now github-spring-cloud for most Spring Cloud projects).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update dependencies in the apps metadata plugin
2 participants