Maven ist 3.1.0.Maven Versionen-Maven-Plugin-Versionen Plugin 2.2
Ich verwende Versionen-Maven-Plugin: 2.2 in meinem Projekt pom.xml (wie unten gezeigt). Neben der üblichen pom.xml Datei-Konfiguration, ich bin nur der Haupt-Code Schnappschuss zeigt unter:
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>tools-parent</artifactId>
<version>0.0.7-SNAPSHOT</version>
<packaging>pom</packaging>
<description>
Infrastructure related to the "vapp" and
"deployer" utilities.
</description>
<parent>
<groupId>com.company.product</groupId>
<artifactId>deploy-parent</artifactId>
<version>0.0.6-SNAPSHOT</version>
</parent>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.9.4</version>
<configuration>
<connectionType>connection</connectionType>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<!-- Make sure that only non-snapshot versions are used for the dependencies. Only active when property 'snapshotDependencyAllowed' is false. -->
<id>enforce-no-snapshots</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<skip>${snapshotDependencyAllowed}</skip>
<rules>
<requireReleaseDeps>
<message>No Snapshots Allowed!</message>
</requireReleaseDeps>
<requireReleaseVersion>
<message>No Snapshots Allowed!</message>
</requireReleaseVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Nun, wenn ich laufen: mvn sauber installieren, baut es erfolgreich.
HINWEIS: In meinem Projekt habe ich einen übergeordneten Abschnitt, wo ich deploy-Parent Artefakt abhängig bin, deren Gruppen-ID "com.company.product" ist die gleiche Gruppen-ID, was ich Tools-Parent Artefakt (dessen pom.xml ich oben eingefügt habe) aber deploy-parent ist ein Artefakt eines anderen Repositories/Projekts.
Wenn ich: mvn Versionen: set -DnewVersion = 0.0.7, bekomme ich die folgende Fehlermeldung.
[INFO] ------------------------------------------------------------------------
[INFO] Building tools-parent 0.0.7-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.2:set (default-cli) @ tools-parent ---
[INFO] Searching for local aggregator root...
[INFO] Local aggregation root: /user/home/u100123/giga/tools
[INFO] Processing change of com.company.product:tools-parent:0.0.7-SNAPSHOT -> 0.0.7
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] tools-parent .................................... FAILURE [1.093s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.404s
[INFO] Finished at: Fri May 01 20:44:22 GMT-00:00 2015
[INFO] Final Memory: 12M/246M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:versions-maven-plugin:2.2:set (default-cli) on project tools-parent: Execution default-cli of goal org.codehaus.mojo:versions-maven-plugin:2.2:set failed. NullPointerException -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
NOW, wenn ich die Versionen-Maven-Plugin-Version ändern zurück auf 2,1 (das, was ich früher wurde mit), die oben mvn Versionen: set -DnewVersion = 0.0.7 Befehl erfolgreich arbeitet und Die Datei pom.xml wird erfolgreich in <version>0.0.7</version>
für Tools-Parent-Artefakte geändert.
Mit Version 2.2, gibt es mir den Fehler und nicht die Version auf 0.0.7 zu ändern.
- Gibt es Gründe, warum 2.2 nicht funktioniert? Was kann getan werden, um es zu lösen?
Am wichtigsten hier ist, dass die offizielle Ankündigung noch nicht gegeben wurde ... – khmarbaise
Hm .. vielen Dank für die gemeinsame Nutzung. –