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

Fix POM #623

Closed
wants to merge 19 commits into from
Closed

Fix POM #623

wants to merge 19 commits into from

Conversation

Adrian-Devries
Copy link
Contributor

Modernize and standardize POM, concentrate version management into top-level POM

Modernize and standardize POM, concentrate version management into top-level POM
Modernize and standardize POM, concentrate version management into top-level POM
Modernize and standardize POM, concentrate version management into top-level POM
Modernize and standardize POM, concentrate version management into top-level POM
Update two dependencies (logback, schematron)
@jstaerk
Copy link
Collaborator

jstaerk commented Dec 20, 2024

What are the changes (the diff shows only red and green) and we had one POM change request which unfortunately consistently failed on that -- will the maven publish still work afterwards?

Update some versions (logback, assertj-core)
@Adrian-Devries
Copy link
Contributor Author

Adrian-Devries commented Dec 20, 2024

Find patch attached. POM.patch

With regards to motivation for modifying the Maven config: Find log files attached, resulting from a compilation run against the current master. mustangproject-master-logs.zip

With regards to build issues:

As far as I see there are two reasons why the build fails:

Error: Tests run: 14, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.568 s <<< FAILURE! -- in org.mustangproject.ZUGFeRD.ZF2PushTest
Error: org.mustangproject.ZUGFeRD.ZF2PushTest.testRead -- Time elapsed: 0.002 s <<< ERROR!
org.mustangproject.ZUGFeRD.ZUGFeRDExportException: java.nio.file.NoSuchFileException: \Users\jstaerk\temp\1424413_anonymized.xml

This one has been fixed with PR#626. The issue has nothing to do with PR#623.

[INFO] Running org.mustangproject.ZUGFeRD.DeSerializationTest
Error: Tests run: 9, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.567 s <<< FAILURE! -- in org.mustangproject.ZUGFeRD.DeSerializationTest
Error: org.mustangproject.ZUGFeRD.DeSerializationTest.testFileSerialization -- Time elapsed: 0.021 s <<< FAILURE!
junit.framework.AssertionFailedError

For me it works:

[INFO] Running org.mustangproject.ZUGFeRD.DeSerializationTest
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.855 s -- in org.mustangproject.ZUGFeRD.DeSerializationTest

Find log files attached. Mustang-CLI-2.15.3-SNAPSHOT-logs.zip So, this issue has nothing to do with PR#623 as well.

Update certain dependencies (core-jakarta)
Update certain dependencies (logback)
Update project.parent.version
Update project.parent.version
Update project.parent.version
@FrankHossfeld
Copy link

Please do not change the tab-size. This makes it nearly impossible to find all changes.

@J-N-K
Copy link
Contributor

J-N-K commented Jan 2, 2025

Probably something like spotless should be added to the code to ensure consistent formatting.

      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless.version}</version>
        <configuration>
          <java>
            <palantirJavaFormat>
              <version>2.36.0</version>
            </palantirJavaFormat>
            <removeUnusedImports/>
            <endWithNewline/>
          </java>
          <pom>
            <sortPom>
              <expandEmptyElements>false</expandEmptyElements>
              <indentSchemaLocation>true</indentSchemaLocation>
              <predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
              <sortDependencyManagement/>
              <sortDependencyExclusions/>
              <sortProperties>true</sortProperties>
            </sortPom>
          </pom>
        </configuration>
        <executions>
          <execution>
            <id>codestyle_check</id>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>initialize</phase>
          </execution>
        </executions>
      </plugin>

Edit: In GitHub you can suppress whitespace changes when viewing the diff (at the top of the page, where you can select inlined of sid-by-side view).

@Adrian-Devries
Copy link
Contributor Author

Please do not change the tab-size. This makes it nearly impossible to find all changes.

I did not change the tab size. What you're claiming about is the missing normalization of the original Maven configuration.

@Adrian-Devries
Copy link
Contributor Author

Probably something like spotless should be added to the code to ensure consistent formatting.

      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless.version}</version>
        <configuration>
          <java>
            <palantirJavaFormat>
              <version>2.36.0</version>
            </palantirJavaFormat>
            <removeUnusedImports/>
            <endWithNewline/>
          </java>
          <pom>
            <sortPom>
              <expandEmptyElements>false</expandEmptyElements>
              <indentSchemaLocation>true</indentSchemaLocation>
              <predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
              <sortDependencyManagement/>
              <sortDependencyExclusions/>
              <sortProperties>true</sortProperties>
            </sortPom>
          </pom>
        </configuration>
        <executions>
          <execution>
            <id>codestyle_check</id>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>initialize</phase>
          </execution>
        </executions>
      </plugin>

Edit: In GitHub you can suppress whitespace changes when viewing the diff (at the top of the page, where you can select inlined of sid-by-side view).

Yes, I agree. I have added the openrewrite plugin to my pull request:

<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>${rewrite-maven-plugin.version}</version>
<dependencies>
	<dependency>
		<groupId>org.openrewrite.recipe</groupId>
		<artifactId>rewrite-logging-frameworks</artifactId>
		<version>${rewrite-logging-frameworks.version}</version>
	</dependency>
	<dependency>
		<groupId>org.openrewrite.recipe</groupId>
		<artifactId>rewrite-migrate-java</artifactId>
		<version>${rewrite-migrate-java.version}</version>
	</dependency>
	<dependency>
		<groupId>org.openrewrite.recipe</groupId>
		<artifactId>rewrite-static-analysis</artifactId>
		<version>${rewrite-static-analysis.version}</version>
	</dependency>
</dependencies>
<configuration>
	<activeRecipes>
		<recipe>org.openrewrite.maven.BestPractices</recipe>
		<recipe>org.openrewrite.maven.ModernizeObsoletePoms</recipe>
		<recipe>org.openrewrite.java.OrderImports</recipe>
		<recipe>org.openrewrite.java.RemoveUnusedImports</recipe>
		<recipe>org.openrewrite.java.ShortenFullyQualifiedTypeReferences</recipe>
		<recipe>org.openrewrite.java.format.AutoFormat</recipe>
		<recipe>org.openrewrite.java.format.BlankLines</recipe>
		<recipe>org.openrewrite.java.format.EmptyNewlineAtEndOfFile</recipe>
		<recipe>org.openrewrite.java.format.MethodParamPad</recipe>
		<recipe>org.openrewrite.java.format.NoWhitespaceAfter</recipe>
		<recipe>org.openrewrite.java.format.NoWhitespaceBefore</recipe>
		<recipe>org.openrewrite.java.format.NormalizeFormat</recipe>
		<recipe>org.openrewrite.java.format.NormalizeLineBreaks</recipe>
		<recipe>org.openrewrite.java.format.NormalizeTabsOrSpaces</recipe>
		<recipe>org.openrewrite.java.format.RemoveTrailingWhitespace</recipe>
		<recipe>org.openrewrite.java.format.SingleLineComments</recipe>
		<recipe>org.openrewrite.java.format.Spaces</recipe>
		<recipe>org.openrewrite.java.format.TabsAndIndents</recipe>
		<recipe>org.openrewrite.java.format.TypecastParenPad</recipe>
		<recipe>org.openrewrite.java.format.WrappingAndBraces</recipe>
		<recipe>org.openrewrite.java.logging.PrintStackTraceToLogError</recipe>
		<recipe>org.openrewrite.java.logging.slf4j.Slf4jBestPractices</recipe>
		<recipe>org.openrewrite.java.migrate.Java8toJava11</recipe>
		<recipe>org.openrewrite.staticanalysis.UnnecessaryParentheses</recipe>
	</activeRecipes>
	<activeStyles>
		<style>org.openrewrite.java.IntelliJ</style>
	</activeStyles>
	<checkstyleDetectionEnabled>false</checkstyleDetectionEnabled>
</configuration>
<executions>
	<execution>
		<goals>
			<goal>dryRunNoFork</goal>
		</goals>
		<phase>verify</phase>
	</execution>
</executions>

This way, the Java sources and the Maven configuration would be normalized.

@FrankHossfeld
Copy link

The tab-size has been changed from 4 to 8 characters. Please use 4 characters.

@Adrian-Devries Adrian-Devries mentioned this pull request Jan 4, 2025
@Adrian-Devries
Copy link
Contributor Author

I do not want to discuss about white space. I would like to focus on the real issues. Find inspection results attached:

(I attach the XML version only because the other versions HTML and JSON are too big.)

I have filed another pull request #644. Therefore, I am going to close this one.

@Adrian-Devries
Copy link
Contributor Author

See above.

@Adrian-Devries Adrian-Devries deleted the fix-pom branch January 6, 2025 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants