bazelbuild / migration-tooling

Migration tools for Bazel
Apache License 2.0
44 stars 30 forks source link

${project.basedir} not interpolated in repositories #63

Open jkinkead opened 6 years ago

jkinkead commented 6 years ago

This bug may just be "interpolation does not happen anywhere", but I'm specifically running into issues with local repositories like this:

<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                      https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <repositories>
    <repository>
      <id>project.local</id>
      <name>project</name>
      <url>file:${project.basedir}/repo</url>
    </repository>
  </repositories>

  <groupId>com.example</groupId>
  <artifactId>example</artifactId>
  <version>0.1.0-SNAPSHOT</version>
  <packaging>pom</packaging>
</project>

The repo directory here would contain a local maven repository with artifacts.

For whatever reason, the resolver is never getting the ${project.basedir} value interpolated, and therefore sees a bad filename.

I've tried numerous changes, but can't figure out what's missing. The relevant section of the docs implies it should Just Happen, although I also think that the wiping of profiles that the model resolver does is contributing the problem. Without any profiles set, this won't get interpolated - although removing that line doesn't actually fix the problem.