eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.22k stars 868 forks source link

Reinstalling node or yarn even if there are already installed in selected versions in installDirectory/node e.g. target/node #982

Closed nmr987 closed 3 years ago

nmr987 commented 3 years ago

Do you want to request a feature or report a bug? report a bug

What is the current behavior? With help of maven-clean-plugin I was able to exclude target/node directory from deleting when e.g. "mvn clean package" is called. However your install-node-and-yarn task is downloading node and yarn again, altought there are already installed in wanted versions in target/node location. When I am calling "mvn package" I get "Yarn/Node {version} is already installed". So why this doesn't happen in case of "mvn clean package", if target/node exists?

If the current behavior is a bug, please provide the steps to reproduce.

  1. Exclude target/node from clean command with following maven-clean-plugin configuration `org.apache.maven.plugins maven-clean-plugin
        <version>3.1.0</version>
            <configuration>
                <excludeDefaultDirectories>true</excludeDefaultDirectories>
                <filesets>
                    <fileset>
                        <directory>target</directory>
                        <includes>
                            <include>**</include>
                        </includes>
                        <excludes>
                            <exclude>node</exclude>
                        </excludes>
                    </fileset>
                </filesets>
            </configuration>
        </plugin>

    `

  2. call "mvn clean package"

What is the expected behavior? Task install-node-and-yarn should show info about Yarn and Node already installed.

Please mention your frontend-maven-plugin and operating system version. 1.12.0 Windows 10 Home Version 20H2

nmr987 commented 3 years ago

My fault, should be `

node/**
                        </excludes>`