Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'.mvn' directory search is not recursive #2673

Open
galusben opened this issue Aug 29, 2024 · 1 comment · Fixed by jfrog/jfrog-cli-core#1273
Open

'.mvn' directory search is not recursive #2673

galusben opened this issue Aug 29, 2024 · 1 comment · Fixed by jfrog/jfrog-cli-core#1273
Labels
bug Something isn't working

Comments

@galusben
Copy link
Contributor

galusben commented Aug 29, 2024

Describe the bug

The .mvn directory is used for extra configurations like mvnw config and extensions.
The convention and the way maven itself works is that every time a mvn command is running, it will transitively search for the .mvn directory from the current path up to the root path, so it will be easy for developers to include this directory only on the top of their project, while maven will respect the extra configuration regardless of where it was running.

When using JFrog CLI, this is not the case and the command will search only for .mvn on the local path where the command was executed.

So, if we will run:

jfrog mvn clean install
It will search for the .mvn directory only in the local directory.

If we will run

mvn clean install

Will search all the way up until it will either hit a .mvn directory or get to the root of the accessible file system.

Current behavior

We are currently forced to maintain multiple .mvn directories within our project. This situation arises because developers and CI pipelines run Maven commands in multiple locations throughout the project, necessitating the presence of the .mvn directory in each of these locations.

Ideally, we would maintain a single .mvn directory at the root of the project, with the following structure:

root
│
├── .mvn
│   └── extensions.xml
│
├── module1
│   ├── src
│   │   ├── main
│   │   │   └── java
│   └── pom.xml
│
└── module2
    ├── src
    │   ├── main
    │   │   └── java
    └── pom.xml

However, due to the current behavior, we are required to duplicate the .mvn directory and extensions.xml file within each module, resulting in the following structure:

root
│
├── .mvn
│   └── extensions.xml
│
├── module1
│   ├── src
│   │   ├── main
│   │   │   └── java
│   ├── pom.xml
│   └── .mvn
│       └── extensions.xml
│
└── module2
    ├── src
    │   ├── main
    │   │   └── java
    ├── pom.xml
    └── .mvn
        └── extensions.xml

This duplication increases maintenance overhead and introduces potential inconsistencies, as each extensions.xml file must be kept in sync across all locations.

Reproduction steps

No response

Expected behavior

No response

JFrog CLI version

2.64.1

Operating system type and version

Linux and Mac OS

JFrog Artifactory version

No response

JFrog Xray version

No response

@galusben galusben added the bug Something isn't working label Aug 29, 2024
@galusben
Copy link
Contributor Author

Related issue:
#2485

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant