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

chore: use type-safe DSL instead of direct XML manipulation for pom.xml #1330

Merged
merged 1 commit into from
Feb 21, 2021

Conversation

Fiouz
Copy link
Contributor

@Fiouz Fiouz commented Feb 21, 2021

Dedicated DSL usage should be safer in order to detect typos.

This has the side effect of changing the order of the XML elements, but
this is more canonical this way.

$ diff -u3 picocli-groovy/pom-default.xml picocli-groovy/build/publications/MyPublication/pom-default.xml
--- picocli-groovy/pom-default.xml 2021-02-21 11:18:23.755921800 +0800
+++ picocli-groovy/build/publications/MyPublication/pom-default.xml     2021-02-21 11:20:45.363477600 +0800
@@ -1,18 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <modelVersion>4.0.0</modelVersion>
   <groupId>info.picocli</groupId>
   <artifactId>picocli-groovy</artifactId>
   <version>4.6.2-SNAPSHOT</version>
-  <dependencies>
-    <dependency>
-      <groupId>info.picocli</groupId>
-      <artifactId>picocli</artifactId>
-      <version>4.6.2-SNAPSHOT</version>
-      <scope>compile</scope>
-    </dependency>
-  </dependencies>
-  <packaging>jar</packaging>
   <name>picocli-groovy</name>
   <description>Picocli Groovy - easily use picocli in Groovy scripts.</description>
   <url>http://picocli.info</url>
@@ -32,8 +24,16 @@
     </developer>
   </developers>
   <scm>
-    <url>https://github.com/remkop/picocli/tree/master</url>
     <connection>scm:git:https://github.com/remkop/picocli.git</connection>
     <developerConnection>scm:git:ssh://github.com:remkop/picocli.git</developerConnection>
+    <url>https://github.com/remkop/picocli/tree/master</url>
   </scm>
+  <dependencies>
+    <dependency>
+      <groupId>info.picocli</groupId>
+      <artifactId>picocli</artifactId>
+      <version>4.6.2-SNAPSHOT</version>
+      <scope>compile</scope>
+    </dependency>
+  </dependencies>
 </project>

https://docs.gradle.org/4.8/release-notes.html#customizing-the-generated-pom
https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom

Dedicated DSL usage should be safer in order to detect typos.

This has the side effect of changing the order of the XML elements, but
this is more canonical this way.

https://docs.gradle.org/4.8/release-notes.html#customizing-the-generated-pom
https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom
@codecov
Copy link

codecov bot commented Feb 21, 2021

Codecov Report

Merging #1330 (b561cfa) into master (c353a28) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1330   +/-   ##
=========================================
  Coverage     93.79%   93.79%           
  Complexity      474      474           
=========================================
  Files             2        2           
  Lines          6961     6961           
  Branches       1869     1869           
=========================================
  Hits           6529     6529           
  Misses          146      146           
  Partials        286      286           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c353a28...b561cfa. Read the comment docs.

@remkop remkop merged commit 686c6dc into remkop:master Feb 21, 2021
@remkop remkop added this to the 4.7 milestone Feb 21, 2021
@remkop remkop added the theme: build An issue or change related to the build system label Feb 21, 2021
@remkop
Copy link
Owner

remkop commented Feb 21, 2021

Merged. Thank you for the contribution!
I will update the release notes soon.

@Fiouz Fiouz deleted the Gradle_publication_optimization branch February 21, 2021 09:44
@remkop
Copy link
Owner

remkop commented Feb 21, 2021

Release notes are updated.
Thank you again for the contribution!

@remkop remkop modified the milestones: 4.7, 4.6.2 Feb 23, 2021
MarkoMackic pushed a commit to MarkoMackic/picocli that referenced this pull request Oct 17, 2021
MarkoMackic added a commit to MarkoMackic/picocli that referenced this pull request Oct 17, 2021
MarkoMackic added a commit to MarkoMackic/picocli that referenced this pull request Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: build An issue or change related to the build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants