Maven - unable to free project due to unallocated dependencies

I am using a multi-module pom setup and when using the release plugin I cannot do it. I am getting the error:

Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:prepare (default-cli) on project libraryparent: Can't release project due to non released dependencies :
com.xyz:libraryparent:pom:1.1-SNAPSHOT
in project 'utils' (com.xyz:utils:jar:1.1-SNAPSHOT)

      

the command I'm running is:

mvn -B release:clean release:prepare release:perform -DdryRun=true -DdevelopmentVersion=1.2-SNAPSHOT -DreleaseVersion=1.1

      

Here are the main parts of the files that I think are relevant:

libraryparent

<modelVersion>4.0.0</modelVersion>
  <groupId>com.xyz</groupId>
  <artifactId>libraryparent</artifactId>
  <version>1.1-SNAPSHOT</version>
  <packaging>pom</packaging>

  <name>parent library</name>
  <description>A parent pom for all library modules</description>

    <modules>
        <module>../util</module>
        <module>../streams</module>
    </modules>

  <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5</version>
        <configuration>
            <releaseProfiles>release</releaseProfiles>
            <goals>deploy assembly:single</goals>
            <!--
            <autoVersionSubmodules>true</autoVersionSubmodules>
            -->
        </configuration>
    </plugin>

      

Util

<project .....>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>util</artifactId>
    <packaging>jar</packaging>

    <parent>
        <groupId>com.xyz</groupId> 
        <artifactId>libraryparent</artifactId> 
        <relativePath>../libraryparent/pom.xml</relativePath>
        <version>1.1-SNAPSHOT</version> 
    </parent>
</project>

      

Streams

<project .....>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>streams</artifactId>
    <packaging>jar</packaging>

    <parent>
        <groupId>com.xyz</groupId>
        <artifactId>libraryparent</artifactId> 
        <relativePath>../libraryparent/pom.xml</relativePath>
        <version>1.1-SNAPSHOT</version>
    </parent>

    <dependencies>

        <dependency>
            <groupId>com.xyz</groupId>
            <artifactId>util</artifactId>
            <version>1.1-SNAPSHOT</version>
            <!--
            <version>${project.parent.version}</version>
            -->
            <classifier>j2me</classifier>
            <optional>true</optional>
        </dependency>

    </dependencies>

</project>

      

I would suspect that the release plugin might set versions to its release versions, etc.

Thank.

+3


source to share


2 answers


maven-release-plugin

checks if parent and dependent items are part of a multi-module project. If it didn't recognize it either because of a different version or because of a typo in the groupId and / or artifactId. com.xyz

probably fake, so please check this value again. Some might say that flat projects (like this one) are not supported by the maven-release plugin. However, there are many integration tests out there that confirm flat designs are supported.



+3


source


I think I just found a solution,

I will do a more complete test soon and publish the results.

Change the targets of the maven-release-plugin:

          <goals>deploy assembly:single</goals>

      



to that

          <goals>deploy</goals>

      

... end...

0


source







All Articles