Coder Social home page Coder Social logo

Comments (5)

Ekryd avatar Ekryd commented on July 26, 2024

Hi!
No parameter for this currently, I can have a look and see how it is handled.

from sortpom.

Ekryd avatar Ekryd commented on July 26, 2024

I was not able to reproduce the problem. Used v3.2.0 with the following elements:

      <dependency>
        <!-- some comment
          continued here -->
        <groupId>org.dom4j</groupId>
        <artifactId>dom4j</artifactId>
        <version>2.1.3</version>
      </dependency>

and the properties

        <plugin>
          <groupId>com.github.ekryd.sortpom</groupId>
          <artifactId>sortpom-maven-plugin</artifactId>
          <version>3.2.0</version>
          <configuration>
            <createBackupFile>false</createBackupFile>
            <predefinedSortOrder>custom_1</predefinedSortOrder>
            <lineSeparator>\n</lineSeparator>
            <encoding>${project.build.sourceEncoding}</encoding>
            <sortProperties>true</sortProperties>
            <sortDependencies>scope,groupId,artifactId</sortDependencies>
            <indentSchemaLocation>true</indentSchemaLocation>
          </configuration>
        </plugin>

from sortpom.

lestephane avatar lestephane commented on July 26, 2024

Sorry I was mistaken about who's causing what. The tidy:pom target outputs xml without the newline.

<dependency><!--

If i run sortpom even with <lineSeparator/> (ie, no separator), the xml is changed to

<dependency>
    <!--

And I wanted a way to have sortpom:sort behave the same as tidy:pom while I migrate a bunch of modules.
After that I'll drop tidy, and just use sortpom, but for now I want to avoid diffs when a person is using one
plugin vs another (at least on that aspect of comment handling). This handling of comments is the only problem
I have left. And I was hoping there was a way to not have sortpom insert the newline before a text comment, or
just respect the formatting that is already there and not touch it if everything is already sorted. My understanding
is that everything in sortpom is configureable, and so I was asking which config item I can use to prevent the
insertion of the newline in front of xml comments, basically.

from sortpom.

Ekryd avatar Ekryd commented on July 26, 2024

Glad that it was resolved

from sortpom.

Ekryd avatar Ekryd commented on July 26, 2024

There is another goal, verify That can check the pom and only reformat it if the elements are in the wrong place. It that doesnโ€™t work, experiment some more and feel free to add suggestion ( or even better, a PR!) of new functionality.

from sortpom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.