it-crowd / pom-sorter Goto Github PK
View Code? Open in Web Editor NEWPlugin for IntelliJ Idea to sort pom.xml
Plugin for IntelliJ Idea to sort pom.xml
before:
<argument><![CDATA[&&]]></argument>
after:
<argument><![CDATA[<![CDATA[&&]]>]]></argument>
before:
<argument>&&</argument>
after:
<argument><![CDATA[&&]]></argument>
If the inside of the unit is the first comment, I'd like to keep it first (relevant only to the first comment in the block)
before sorting:
<mirror>
<!-- United States, St. Louis-->
<mirrorOf>central</mirrorOf>
<url>http://repo1.maven.org/maven2</url>
<id>Central</id>
</mirror>
after sorting (for now):
<mirror>
<id>Central</id>
<!-- United States, St. Louis-->
<mirrorOf>central</mirrorOf>
<url>http://repo1.maven.org/maven2</url>
</mirror>
after sorting (would like to):
<mirror>
<!-- United States, St. Louis-->
<id>Central</id>
<mirrorOf>central</mirrorOf>
<url>http://repo1.maven.org/maven2</url>
</mirror>
Hello,
First of all, thanks for the plugin.
With the latest update, the plugin failms to start with an "Unsupported major.minor version 51.0" that is typical of classes compiled with JDK newer than the runtime one. I'm running IntelliJ using Java6 on OSX, and I suppose that the new plugin has been compiled with Java7. Running IntelliJ with Java7 on OSX has drawbacks especially regarding UI instability, so I would prefer to stick to Java6 runtime.
Best regards,
Vincent
maven.xsd has really good order of all its elements, it would useful to have possibility to sort our poms according to xsd elemets order.
Before:
<configuration>
<target>
<echo message="dfasd"/>
</target>
</configuration>
After:
<configuration>
<target>
<echo></echo>
</target>
</configuration>
This would allow sorting generic xml files, since there is no IntelliJ IDEA plugin to sort xml files.
Example xml file:
<profile kind="CodeFormatterProfile" version="11">
<setting id="paren_in_if" value="do not insert"/>
<setting id="colon_in_assert" value="insert"/>
<setting id="enum_constant" value="end_of_line"/>
<setting id="before_semicolon" value="do not insert"/>
</profile>
Allow sorting setting tags by value of "id" attribute.
Sorry if this is not in scope of this plugin.
The error occurs when you try to sort the settings.xml. When sorting pom-file, the error does not appear.
IDE: IU-132.27
settings.xml: http://pastebin.com/gYYiQGqT
error message: http://pastebin.com/09efg1eM
By default Pom-sorter substitutes those two lines, which causes build to fail:
<mkdir dir="${project.build.directory}/downloads"/>
<get src="http://archive.apache.org/dist/tomcat/tomcat-7/v${version.org.apache.tomcat}/bin/apache-tomcat-${version.org.apache.tomcat}.zip"
dest="${project.build.directory}/downloads" verbose="true" skipexisting="true"/>
Full plugin config:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-test-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<!-- Remove the default ROOT webapp so it won't collide with tests -->
<delete dir="${project.build.directory}/apache-tomcat-${version.org.apache.tomcat}/webapps/ROOT"/>
<mkdir dir="${project.build.directory}/downloads"/>
<get src="http://archive.apache.org/dist/tomcat/tomcat-7/v${version.org.apache.tomcat}/bin/apache-tomcat-${version.org.apache.tomcat}.zip"
dest="${project.build.directory}/downloads" verbose="true" skipexisting="true"/>
<unzip src="${project.build.directory}/downloads/apache-tomcat-${version.org.apache.tomcat}.zip"
dest="${project.build.directory}"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
It would be great to have a way to configure blank lines in between certain tags.
I think there could just be a seperate button to add one to the list of tags.
Moving it up and down and deleting it could work just the same as for tag items in the list.
Currently we can configure how particular tag should be sorted. However sometimes same tag name is used in different context and we would like to define different sort mode for each context.
i.e. maven-antrun-plugin/executions/execution/configuration/target
It would be useful to be able to configure sort mode using pattern like:
/maven-antrun-plugin//target
When you open the Preferences page, download the icon appears as an error in the logs.
screenshot: https://lh6.googleusercontent.com/-pyu35zPd95A/ULdBicNJIsI/AAAAAAAAGu0/ZY4FXt3hZX4/s800/screen000.png
Intellij IDEA: IU-123.23
OS: Ubuntu 12.04 64bit
plugin version: 1.0.7-SNAPSHOT
If <target>
is configured not be sorted, then child tag (simple node) is turned into a "complex" node.
Before:
<target>
<echo message="bla"/>
</target>
After sorting:
<target>
<echo message="bla"></echo>
</target>
This great plugin from time to time changes order of elements in ".idea\misc.xml".
Thus, unfortunately, we cannot use it in our office environment with IDEA-project-files-sharing enabled among IDEA instances - the plugin constantly creates "false changes".
after instaling I get NoClassDefFoundError for org.apache.commons.collections.comparators.NullComparator
Do not freez IDE during sort action. Use progress bar.
sources pom.xml: https://yadi.sk/d/0-0wfEXcVWe5Y
The plugin won't run with the above version of IntelliJ
Plugin 'Pom sorter' failed to initialize and will be disabled. Please restart IntelliJ IDEA.
com.intellij.diagnostic.PluginException: pl/itcrowd/pom_sorter/PomSorter : Unsupported major.minor version 51.0 [Plugin: Pom sorter]
at com.intellij.ide.plugins.cl.PluginClassLoader.b(PluginClassLoader.java:130)
at com.intellij.ide.plugins.cl.PluginClassLoader.a(PluginClassLoader.java:77)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:66)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.a(ComponentManagerImpl.java:408)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.a(ComponentManagerImpl.java:398)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.access$000(ComponentManagerImpl.java:384)
at com.intellij.openapi.components.impl.ComponentManagerImpl.a(ComponentManagerImpl.java:107)
at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:89)
at com.intellij.openapi.project.impl.ProjectImpl.init(ProjectImpl.java:307)
at com.intellij.openapi.project.impl.ProjectManagerImpl.a(ProjectManagerImpl.java:278)
at com.intellij.openapi.project.impl.ProjectManagerImpl.access$300(ProjectManagerImpl.java:82)
at com.intellij.openapi.project.impl.ProjectManagerImpl$9.compute(ProjectManagerImpl.java:562)
at com.intellij.openapi.project.impl.ProjectManagerImpl$9.compute(ProjectManagerImpl.java:558)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$4.run(ProgressManagerImpl.java:240)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:464)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:274)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
at com.intellij.openapi.application.impl.ApplicationImpl$10$1.run(ApplicationImpl.java:642)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:420)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:150)
Caused by: java.lang.UnsupportedClassVersionError: pl/itcrowd/pom_sorter/PomSorter : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.lang.ClassLoader.defineClass(ClassLoader.java:471)
at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:189)
at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:185)
at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:161)
at com.intellij.ide.plugins.cl.PluginClassLoader.b(PluginClassLoader.java:124)
... 31 more
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.