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.25k stars 871 forks source link

the plugin always install the same version of node v4.2.1 #926

Closed jma7889 closed 4 years ago

jma7889 commented 4 years ago

No matter how do I configure it, it always install node v4.2.1

    <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <!-- Use the latest released version:
        https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
        <version>1.10.0</version>

        <executions>
            <execution>
                <!-- optional: you don't really need execution ids, but it looks nice in your build log. -->
                <id>install node and npm</id>
                <goals>
                    <goal>install-node-and-npm</goal>
                </goals>
                <!-- optional: default phase is "generate-resources" -->
                <phase>generate-resources</phase>
                <configuration>
                    <nodeVersion>v12.18.3</nodeVersion>                
                </configuration>
            </execution>
        </executions>
    </plugin>

And result:


[INFO] --- frontend-maven-plugin:1.10.0:install-node-and-npm (install-node-and-npm) @ getgo ---
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://artifactory.psdops.com/public
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://artifactory.psdops.com/public
Downloading from public.psddev: https://artifactory.psdops.com/public/com/github/eirslett/frontend-plugin-core/1.10.0/frontend-plugin-core-1.10.0.pom
Downloaded from public.psddev: https://artifactory.psdops.com/public/com/github/eirslett/frontend-plugin-core/1.10.0/frontend-plugin-core-1.10.0.pom (3.0 kB at 120 kB/s)
[DEBUG] Writing tracking file /Users/jma/.m2/repository/com/github/eirslett/frontend-plugin-core/1.10.0/_remote.repositories
[DEBUG] Writing tracking file /Users/jma/.m2/repository/com/github/eirslett/frontend-plugin-core/1.10.0/frontend-plugin-core-1.10.0.pom.lastUpdated
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=61816, ConflictMarker.markTime=27024, ConflictMarker.nodeCount=34, ConflictIdSorter.graphTime=17951, ConflictIdSorter.topsortTime=34688, ConflictIdSorter.conflictIdCount=26, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=357828, ConflictResolver.conflictItemCount=33, DefaultDependencyCollector.collectTime=171657827, DefaultDependencyCollector.transformTime=520037}
[DEBUG] com.github.eirslett:frontend-maven-plugin:jar:1.10.0
[DEBUG]    com.github.eirslett:frontend-plugin-core:jar:1.10.0:compile
[DEBUG]       org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[DEBUG]       org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[DEBUG]       org.apache.commons:commons-compress:jar:1.19:compile
[DEBUG]       commons-io:commons-io:jar:1.3.2:compile
[DEBUG]       org.apache.commons:commons-exec:jar:1.3:compile
[DEBUG]       org.apache.httpcomponents:httpclient:jar:4.5.2:compile
[DEBUG]          org.apache.httpcomponents:httpcore:jar:4.4.4:compile
[DEBUG]          commons-logging:commons-logging:jar:1.2:compile
[DEBUG]          commons-codec:commons-codec:jar:1.9:compile
[DEBUG]       org.codehaus.plexus:plexus-utils:jar:3.0.22:compile
[DEBUG]       org.slf4j:slf4j-api:jar:1.7.5:compile
[DEBUG]    org.apache.maven:maven-plugin-api:jar:3.5.0:compile
[DEBUG]       org.apache.maven:maven-model:jar:3.5.0:compile
[DEBUG]          org.apache.commons:commons-lang3:jar:3.5:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:3.5.0:compile
[DEBUG]       org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.3:compile
[DEBUG]          javax.enterprise:cdi-api:jar:1.0:compile
[DEBUG]             javax.annotation:jsr250-api:jar:1.0:compile
[DEBUG]             javax.inject:javax.inject:jar:1:compile
[DEBUG]          org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.3:compile
[DEBUG]          org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[DEBUG]          org.codehaus.plexus:plexus-classworlds:jar:2.5.2:compile
[DEBUG]    org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.2:compile
[DEBUG]    org.sonatype.plexus:plexus-build-api:jar:0.0.7:compile
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://artifactory.psdops.com/public
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://artifactory.psdops.com/public
Downloading from public.psddev: https://artifactory.psdops.com/public/com/github/eirslett/frontend-plugin-core/1.10.0/frontend-plugin-core-1.10.0.jar
Downloaded from public.psddev: https://artifactory.psdops.com/public/com/github/eirslett/frontend-plugin-core/1.10.0/frontend-plugin-core-1.10.0.jar (73 kB at 2.1 MB/s)
[DEBUG] Writing tracking file /Users/jma/.m2/repository/com/github/eirslett/frontend-plugin-core/1.10.0/_remote.repositories
[DEBUG] Writing tracking file /Users/jma/.m2/repository/com/github/eirslett/frontend-plugin-core/1.10.0/frontend-plugin-core-1.10.0.jar.lastUpdated
[DEBUG] Created new class realm plugin>com.github.eirslett:frontend-maven-plugin:1.10.0
[DEBUG] Importing foreign packages into class realm plugin>com.github.eirslett:frontend-maven-plugin:1.10.0
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>com.github.eirslett:frontend-maven-plugin:1.10.0
[DEBUG]   Included: com.github.eirslett:frontend-maven-plugin:jar:1.10.0
[DEBUG]   Included: com.github.eirslett:frontend-plugin-core:jar:1.10.0
[DEBUG]   Included: org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13
[DEBUG]   Included: org.codehaus.jackson:jackson-core-asl:jar:1.9.13
[DEBUG]   Included: org.apache.commons:commons-compress:jar:1.19
[DEBUG]   Included: commons-io:commons-io:jar:1.3.2
[DEBUG]   Included: org.apache.commons:commons-exec:jar:1.3
[DEBUG]   Included: org.apache.httpcomponents:httpclient:jar:4.5.2
[DEBUG]   Included: org.apache.httpcomponents:httpcore:jar:4.4.4
[DEBUG]   Included: commons-logging:commons-logging:jar:1.2
[DEBUG]   Included: commons-codec:commons-codec:jar:1.9
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.22
[DEBUG]   Included: org.apache.commons:commons-lang3:jar:3.5
[DEBUG]   Included: javax.enterprise:cdi-api:jar:1.0
[DEBUG]   Included: org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.3
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
[DEBUG]   Included: org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.2
[DEBUG]   Included: org.sonatype.plexus:plexus-build-api:jar:0.0.7
[DEBUG] Configuring mojo com.github.eirslett:frontend-maven-plugin:1.10.0:install-node-and-npm from plugin realm ClassRealm[plugin>com.github.eirslett:frontend-maven-plugin:1.10.0, parent: sun.misc.Launcher$AppClassLoader@55f96302]
[DEBUG] Configuring mojo 'com.github.eirslett:frontend-maven-plugin:1.10.0:install-node-and-npm' with basic configurator -->
[DEBUG]   (f) nodeDownloadRoot = https://nodejs.org/dist/
[DEBUG]   (f) nodeVersion = v4.2.1
[DEBUG]   (f) npmDownloadRoot = https://registry.npmjs.org/npm/-/
[DEBUG]   (f) npmVersion = 2.14.7
[DEBUG]   (f) project = MavenProject: com.getgo:getgo:1.0.0-SNAPSHOT @ /Users/jma/dev/lmi-tmp/pom.xml
[DEBUG]   (f) repositorySystemSession = org.eclipse.aether.DefaultRepositorySystemSession@781654f8
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@1d12e953
[DEBUG]   (f) skipTests = false
[DEBUG]   (f) testFailureIgnore = false
[DEBUG]   (f) workingDirectory = /Users/jma/dev/lmi-tmp
[DEBUG]   (f) execution = com.github.eirslett:frontend-maven-plugin:1.10.0:install-node-and-npm {execution: install-node-and-npm}
[DEBUG] -- end configuration --
[INFO] Installing node version v4.2.1
eirslett commented 4 years ago

Try searching for "4.2.1" in your whole code base, does it appear anywhere?

jma7889 commented 4 years ago

This not in my whole repository, or two mvn projects it depends. But there are more deeper projects dependency that is not exposed. Is there a way to force install of a specific node version?

jma7889 commented 4 years ago

the issue is resolved, I don't know why, but some minor changes to the pom.xml is required

here's the working pom

        <executions>
            <execution>
                <!-- optional: you don't really need execution ids, but it looks nice in your build log. -->
                <id>install-node-and-npm</id>
                <phase>generate-resources</phase>
                <goals>
                    <goal>install-node-and-npm</goal>
                </goals>
                <!-- optional: default phase is "generate-resources" -->
                <configuration>
                    <nodeVersion>v12.18.3</nodeVersion>     
                    <npmVersion>6.14.4</npmVersion>                           
                </configuration>
            </execution>
            <execution>
                <id>npm-install</id>
                <goals>
                    <goal>npm</goal>
                </goals>

                <!-- optional: default phase is "generate-resources" -->
                <phase>generate-resources</phase>

                <configuration>
                    <!-- optional: The default argument is actually
                    "install", so unless you need to run some other npm command,
                    you can remove this whole <configuration> section.
                    -->
                    <arguments>install</arguments>
                </configuration>
            </execution>
        </executions>
eirslett commented 4 years ago

That's strange, but I'm happy to see that you resolved it!