-1
I use Ubuntu 18.04.
My project is on an NTFS partition.
I need to know which variable shows the location the pom.xml file is in.
I’m using the ${basic} variable, but it’s not showing where the pom.xml file is..
It is showing the directory: /home/Gustavo/. m2/Repository/
The strange thing is that this variable works in Windows 10
Hi Rafael, I’ve done it. The strange thing is that these variables work in Windows 10. My environment is Linux 18.04 LTS, and the eclipse I use has the same version (Oxygem March 2018)
– Gustavo Menezes
I updated the answer. I ran the test on Linux and it worked correctly. Maybe your pom.xml has some configuration that is changing the root of the project. Check the example I put in the reply and say what it prints in your environment.
– Rafael Chagas
I followed your instructions Rafael and the variables are pointing to the right place: (project.basedir: /media/Gustavo/New volume/GIT/systems/Commons/Commons-ejb). But I can’t concatenate this variable with another URL in the systemPath property in dependencies in Ubuntu 18, only fucks in Windows 10. Follow the pom.xml line: <systemPath>${project.basedir}.. /.. /Commons/target/Commons-0.0.1.jar</systemPath>
– Gustavo Menezes
What is the folder structure of your Gustavo project?
– Rafael Chagas
i have a COMMONS-EJB project that is on the way: /media/Gustavo/New volume/GIT/systems/Common/Commons-ejb. This project has a dependency on another COMMONS project that is on the following path: /media/Gustavo/New volume/GIT/systems/Commons/Commons
– Gustavo Menezes
In the eclipse I opened the "Effective pom" tab and it is showing in systemPath the following path: <systemPath>/media/Gustavo/New volume/GIT/Common/Systems/Commons-ejb.. /.. /Commons/target/Commons-0.0.1.jar</systemPath>. It is not recognizing the characters ".. /.. /" to go back 2 folders. The strange thing is that in Windows 10 works
– Gustavo Menezes
@Gustavomenezes From your report I think your problem is actually to work with dependencies in Maven. I updated the Github project with a project with this structure that you’re looking for. Import the project and look at the pom’s <modules> structure and how they relate. systempath is only indicated in cases where a dependency is not available in some Maven repository. To use dependencies within the same structure you can use the reference directly in pom.xml.
– Rafael Chagas
Hi Rafael, really these dependencies are not in the Maven repository, because they are company codes where I work and the owners do not want it to be available there.
– Gustavo Menezes
the "Common" directory is just an operating system folder, serves only for organizing the files on the computer. From what I saw on Github you used this "Commons" as a Maven project to group COMMONS and COMMONS-EJB, right?
– Gustavo Menezes
i saw the "systemPath" property in "dependencies", in "Effective pom" when the pom.xml file is in windows. It has the following path: <systemPath>D: GIT Common Systems Commons-ejb.. /.. /Commons/target/Commons-0.0.1.jar</systemPath>. I think the problem is caused by the way Windows and Ubuntu manage their file folders, "/" bars on Linux and counter bars on Windows ""
– Gustavo Menezes
Take a look at the Github project once again. I did it here on my Linux(Ubuntu 20.04) and it worked. <groupid>br.com.rafaelchagasb</groupid> <artifactId>apache-Commons</artifactId> <version>0.0.1</version> <Scope>system</Scope> <systemPath>${project.basedir}/.. /Commons/Commons-lang3-3.10.jar</systemPath> </dependency>
– Rafael Chagas
Good evening Rafael! Thank you so much for your help, it worked!!!
– Gustavo Menezes