You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2024/06/29 21:42:00 UTC

[jira] [Updated] (MDEP-949) enhancedLocalRepository.split=true causes enhancedLocalRepository.localPrefix to be included as top level directory in copy-dependencies with useRepositoryLayout=true

     [ https://issues.apache.org/jira/browse/MDEP-949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Osipov updated MDEP-949:
--------------------------------
    Description: 
After upgrading from Maven 3.8.7 to {*}3.9.8{*}, we decided to take advantage of local repository split feature in our CI/CD pipeline. However, we noticed an unexpected behavior in the copy-dependencies goal.
{code:java}
-Daether.enhancedLocalRepository.split=true{code}
{code:java}
<plugin>
  <artifactId>maven-dependency-plugin</artifactId>
  <version>3.7.1</version>
  <executions>
    <execution>
      <id>copy-libs</id>
      <phase>prepare-package</phase>
      <goals>
        <goal>copy-dependencies</goal>
      </goals>
      <configuration>
        <outputDirectory>${project.build.directory}/libs</outputDirectory>
        <useRepositoryLayout>true</useRepositoryLayout>
        <overWriteReleases>false</overWriteReleases>
        <overWriteSnapshots>false</overWriteSnapshots>
        <overWriteIfNewer>true</overWriteIfNewer>
        <includeScope>runtime</includeScope>
        <includeTypes>jar</includeTypes>
        <copyPom>false</copyPom>
      </configuration>
    </execution>
  </executions>
</plugin>{code}
*Before split local repository enabled:*
{code:java}
target
 ∟libs
   ∟org
    ∟commons
     ∟commons-collections4
      ∟4.4
       ∟commons-collections4-4.4.jar{code}
*After:*
{code:java}
target
 ∟libs
  ∟installed
   ∟org
    ∟commons
     ∟commons-collections4
      ∟4.4
       ∟commons-collections4-4.4.jar{code}
Note additional directory {{{}installed{}}}, which is the default value of property {{-Daether.enhancedLocalRepository.localPrefix}}

*Expected:*

Neither {{aether.enhancedLocalRepository.localPrefix}} nor {{aether.enhancedLocalRepository.remotePrefix}} should appear as top level directory in the outputDirectory.

  was:
After upgrading from Maven 3.8.7 to {*}3.9.8{*}, we decided to take advantage of local repository split feature in our cicd pipeline. However, we noticed an unexpected behavior in the copy-dependencies goal.
{code:java}
-Daether.enhancedLocalRepository.split=true{code}
{code:java}
<plugin>
  <artifactId>maven-dependency-plugin</artifactId>
  <version>3.7.1</version>
  <executions>
    <execution>
      <id>copy-libs</id>
      <phase>prepare-package</phase>
      <goals>
        <goal>copy-dependencies</goal>
      </goals>
      <configuration>
        <outputDirectory>${project.build.directory}/libs</outputDirectory>
        <useRepositoryLayout>true</useRepositoryLayout>
        <overWriteReleases>false</overWriteReleases>
        <overWriteSnapshots>false</overWriteSnapshots>
        <overWriteIfNewer>true</overWriteIfNewer>
        <includeScope>runtime</includeScope>
        <includeTypes>jar</includeTypes>
        <copyPom>false</copyPom>
      </configuration>
    </execution>
  </executions>
</plugin>{code}
*Before split local repository enabled:*
{code:java}
target
 ∟libs
   ∟org
    ∟commons
     ∟commons-collections4
      ∟4.4
       ∟commons-collections4-4.4.jar{code}
*After:*
{code:java}
target
 ∟libs
  ∟installed
   ∟org
    ∟commons
     ∟commons-collections4
      ∟4.4
       ∟commons-collections4-4.4.jar{code}
Note additional folder {{{}installed{}}}, which is the default value of property {{-Daether.enhancedLocalRepository.localPrefix}}

*Expected:*

Neither {{aether.enhancedLocalRepository.localPrefix}} nor {{aether.enhancedLocalRepository.remotePrefix}} should appear as top level folder in the outputDirectory.

 

 

        Summary: enhancedLocalRepository.split=true causes enhancedLocalRepository.localPrefix to be included as top level directory in copy-dependencies with useRepositoryLayout=true  (was: enhancedLocalRepository.split = true causes enhancedLocalRepository.localPrefix to be included as top level folder in copy-dependencies with useRepositoryLayout true)

> enhancedLocalRepository.split=true causes enhancedLocalRepository.localPrefix to be included as top level directory in copy-dependencies with useRepositoryLayout=true
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MDEP-949
>                 URL: https://issues.apache.org/jira/browse/MDEP-949
>             Project: Maven Dependency Plugin
>          Issue Type: Bug
>          Components: copy-dependencies
>    Affects Versions: 3.7.1
>         Environment: Apache Maven 3.9.8 (36645f6c9b5079805ea5009217e36f2cffd34256)
> Maven home: /Users/edrodri/Work/maven/apache-maven-3.9.8
> Java version: 21.0.2, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/graalvm-jdk-21.0.2+13.1/Contents/Home
> Default locale: en_US, platform encoding: UTF-8
> OS name: "mac os x", version: "14.5", arch: "aarch64", family: "mac"
>            Reporter: Eduardo Rodrigues
>            Priority: Major
>
> After upgrading from Maven 3.8.7 to {*}3.9.8{*}, we decided to take advantage of local repository split feature in our CI/CD pipeline. However, we noticed an unexpected behavior in the copy-dependencies goal.
> {code:java}
> -Daether.enhancedLocalRepository.split=true{code}
> {code:java}
> <plugin>
>   <artifactId>maven-dependency-plugin</artifactId>
>   <version>3.7.1</version>
>   <executions>
>     <execution>
>       <id>copy-libs</id>
>       <phase>prepare-package</phase>
>       <goals>
>         <goal>copy-dependencies</goal>
>       </goals>
>       <configuration>
>         <outputDirectory>${project.build.directory}/libs</outputDirectory>
>         <useRepositoryLayout>true</useRepositoryLayout>
>         <overWriteReleases>false</overWriteReleases>
>         <overWriteSnapshots>false</overWriteSnapshots>
>         <overWriteIfNewer>true</overWriteIfNewer>
>         <includeScope>runtime</includeScope>
>         <includeTypes>jar</includeTypes>
>         <copyPom>false</copyPom>
>       </configuration>
>     </execution>
>   </executions>
> </plugin>{code}
> *Before split local repository enabled:*
> {code:java}
> target
>  ∟libs
>    ∟org
>     ∟commons
>      ∟commons-collections4
>       ∟4.4
>        ∟commons-collections4-4.4.jar{code}
> *After:*
> {code:java}
> target
>  ∟libs
>   ∟installed
>    ∟org
>     ∟commons
>      ∟commons-collections4
>       ∟4.4
>        ∟commons-collections4-4.4.jar{code}
> Note additional directory {{{}installed{}}}, which is the default value of property {{-Daether.enhancedLocalRepository.localPrefix}}
> *Expected:*
> Neither {{aether.enhancedLocalRepository.localPrefix}} nor {{aether.enhancedLocalRepository.remotePrefix}} should appear as top level directory in the outputDirectory.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)