I know it is a bad practice, but the situation must have this approach.
I am trying to put part of the dependencies in the project dir itself.
I created a dir called m2
in the project root(it is on the same level as the pom
file) and copied the file structure there. Also, I added this local maven repo to the POM.
The problem is that I am using a parent POM which is located in this new local m2
repo, but it can't get resolved. I am using a windows machine.
Local file repo added to pom:
<repository>
<id>local-maven-repo</id>
<name>asd</name>
<url>file:///${project.basedir}/m2</url>
</repository>
Parent pom definition:
<parent>
<groupId>com.test.example</groupId>
<artifactId>tests-parent</artifactId>
<version>6.3.3</version>
</parent>
Screenshot
mvn -U
shows this error:
Scanning for projects...
Downloading from local-maven-repo: file:///${project.basedir}/m2/com/test/example/tests-parent/6.3.3/tests-parent-6.3.3.pom
Downloading from central: https://repo.maven.apache.org/maven2/com/test/example/tests-parent/6.3.3/tests-parent-6.3.3.pom
Non-resolvable parent POM for com.test.example:tests:1.0.0-SNAPSHOT: Could not find artifact com.test.example:tests-parent:pom:6.3.3 in local-maven-repo (file:///${project.basedir}/m2) and 'parent.relativePath' points at wrong local POM @ line 9, column 10
Looks like the ${project.basedir}
variable is not resolved at all.
Updates:
Tried also with 2 slashes file://
, but still not resolved.