Hello,
I have 90 projects (20 spring boot app and 70 libs) and 30 vuejs projects
(20 SPA and 10 shared components) that is used to build UI (SPA) for the 20
spring boot apps.

Currently I have a python script that scans the 20 vuejs project to build a
dependency tree and build them in order. Once done, the artifacts are
copied to the resource folder of the corresponding spring boot project then
i use maven to build all the 90 java projects using a single aggregator pom
that list all 90 java projects as modules.

This process is find if i need all 20 spring boot app. However, there are
times that i only need to build 1 or 2 spring boot app form the 20. The
Python script still need to build the dependencies and all vuewjs project
which waste a lot of time.

What i want is to add all the 30 vuejs projects to the aggregator pom as
module and somehow declare dependencies between them so that when i run mvn
--projects A --also-make then only the necessary projects are built.

At the moment my challenge is that when i declare a vuejs project A as
dependency of a vuejs project B, maven tries to download B which does not
exist in any maven repo.
Here is an example:
------------------
<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
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com</groupId>
    <artifactId>B</artifactId>
    <version>7.1.8-SNAPSHOT</version>
    <packaging>war</packaging> <!-- Use 'war' if your Vue.js project is a
Single Page Application (SPA) -->

    <dependencies>
    <dependency>
        <groupId>com</groupId>
            <artifactId>A</artifactId>
            <version>7.1.8-SNAPSHOT</version>
    </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Configure Vue.js build here -->
            <!-- For example, you can use the Vue CLI to build your Vue.js
project -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>npm-install</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <workingDirectory>${basedir}</workingDirectory>
                            <executable>npm</executable>
                            <commandlineArgs>install --@private:registry=
http://localhost:4873 --loglevel error</commandlineArgs>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm-build</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <workingDirectory>${basedir}</workingDirectory>
                            <executable>npm</executable>
                            </commandlineArgs>run build --loglevel
error</commandlineArgs>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm-publish</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <workingDirectory>${basedir}</workingDirectory>
                            <executable>npm</executable>
                            </commandlineArgs>publish --@private:registry=
http://localhost:4873 --loglevel error</commandlineArgs>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
-----------------------

Is there a way to tell maven to not look for the dependency A when building
B but still let the reactor know that A has to be built before B

Regards
Thai Le

Reply via email to