Skip to content

[Question] Maven dependency management for monorepo libs #204

@ToppScorer

Description

@ToppScorer

Hi!

I'm not sure if I use nx-spring-boot in the correct way:

I have a monorepo where I have a Maven library project (under libs) and a Maven application project (under apps). In the POM of the application a dependency to the library project is defined:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>test</groupId>
  <artifactId>test-service</artifactId>
  <version>${revision}</version>
  <dependencies>
    <dependency>
      <groupId>test</groupId>
      <artifactId>test-library</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>
  ...

When I try to install the application, I would expect, that the library is installed first:

    "install": {
      "executor": "@nxrocks/nx-spring-boot:install",
      "options": {
        "root": "apps/test-service"
      },
      "dependsOn": [
        "^install",
        "clean"
      ],
      "outputs": [
        "{workspaceRoot}/apps/test-service/target"
      ]
    }

But the Maven build fails because it cannot find the library in the defined Maven repositories. It seems, that the POM is not analyzed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions