maven-model-jdom-support

CommonJava top-level parent POM.

Лицензия

Лицензия

Категории

Категории

Maven Компиляция и сборка JDOM Прикладные библиотеки
Группа

Группа

org.commonjava.maven
Идентификатор

Идентификатор

maven3-model-jdom-support
Последняя версия

Последняя версия

1.6
Дата

Дата

Тип

Тип

jar
Описание

Описание

maven-model-jdom-support
CommonJava top-level parent POM.
Система контроля версий

Система контроля версий

http://github.com/commonjava/maven-model-jdom-support

Скачать maven3-model-jdom-support

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.commonjava.maven/maven3-model-jdom-support/ -->
<dependency>
    <groupId>org.commonjava.maven</groupId>
    <artifactId>maven3-model-jdom-support</artifactId>
    <version>1.6</version>
</dependency>
// https://jarcasting.com/artifacts/org.commonjava.maven/maven3-model-jdom-support/
implementation 'org.commonjava.maven:maven3-model-jdom-support:1.6'
// https://jarcasting.com/artifacts/org.commonjava.maven/maven3-model-jdom-support/
implementation ("org.commonjava.maven:maven3-model-jdom-support:1.6")
'org.commonjava.maven:maven3-model-jdom-support:jar:1.6'
<dependency org="org.commonjava.maven" name="maven3-model-jdom-support" rev="1.6">
  <artifact name="maven3-model-jdom-support" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.commonjava.maven', module='maven3-model-jdom-support', version='1.6')
)
libraryDependencies += "org.commonjava.maven" % "maven3-model-jdom-support" % "1.6"
[org.commonjava.maven/maven3-model-jdom-support "1.6"]

Зависимости

compile (6)

Идентификатор библиотеки Тип Версия
org.jdom : jdom2 jar 2.0.6
org.apache.maven : maven-model jar 3.0.3
org.apache.maven : maven-repository-metadata jar 3.0.3
org.apache.maven : maven-settings jar 3.0.3
org.apache.maven : maven-core jar 3.0.3
commons-io : commons-io jar 2.4

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.hamcrest : hamcrest-core jar 1.3

Модули Проекта

Данный проект не имеет модулей.

JDom Support for Common Maven Models

This project simply extracts the Modello source files from the Apache Maven distribution source zip, and re-runs the Modello Maven plugin on them using the 'jdom-writer' goal. The point of this exercise is to provide a reusable artifact that contains the JDom ModelWriter classes for common models found in Maven. The advantage to the JDom writers is that they can preserve existing order of elements, formatting, and comments.

Currently, this project produces writers for the following models:

  • pom.xml
  • settings.xml
  • toolchains.xml
  • maven-metadata.xml

Example

To write changes to a Maven pom.xml, with formats/comments preserved:

File pom = new File( "pom.xml" );
Writer writer = null;
try
{
    final SAXBuilder builder = new SAXBuilder();
    builder.setIgnoringBoundaryWhitespace( false );
    builder.setIgnoringElementContentWhitespace( false );

    final Document doc = builder.build( pom );

    String encoding = model.getModelEncoding();
    if ( encoding == null )
    {
        encoding = "UTF-8";
    }

    final Format format = Format.getRawFormat().setEncoding( encoding ).setTextMode( TextMode.PRESERVE );

    writer = WriterFactory.newWriter( pom, encoding );

    new MavenJDOMWriter().write( model, doc, writer, format );
}
finally
{
    IOUtil.close( writer );
}

To use this code, you'll have to add the JDom dependency to your project's pom.xml:

<dependency>
  <groupId>org.jdom</groupId>
  <artifactId>jdom</artifactId>
  <version>1.1</version>
</dependency>
org.commonjava.maven

Red Hat NOS

Middleware pipeline content management projects

Версии библиотеки

Версия
1.6
1.5
1.4
1.3.1