jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.54k stars 4.02k forks source link

yarnVersion missing #8318

Closed arabbani closed 6 years ago

arabbani commented 6 years ago
Overview of the issue

The parameters 'yarnVersion' for goal com.github.eirslett:frontend-maven-plugin:1.6:install-node-and-yarn are missing or invalid

[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< com.creatives.apsstr:fb-quiz >--------------------
[INFO] Building Fb Quiz 0.0.1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.0.4.RELEASE:run (default-cli) > test-compile @ fb-quiz >>>
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:copy-resources (default-resources) @ fb-quiz ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 44 resources
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ fb-quiz ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 44 resources
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-versions) @ fb-quiz ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:copy-resources (docker-resources) @ fb-quiz ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.2:prepare-agent (pre-unit-tests) @ fb-quiz ---
[INFO] argLine set to "-javaagent:C:\\Users\\Arif Rabbani\\.m2\\repository\\org\\jacoco\\org.jacoco.agent\\0.8.2\\org.jacoco.agent-0.8.2-runtime.jar=destfile=D:\\Projects\\arif\\fb-quiz\\target\\test-results\\coverage\\jacoco\\jacoco.exec" -Djava.security.egd=file:/dev/./urandom -Xmx256m
[INFO]
[INFO] --- frontend-maven-plugin:1.6:install-node-and-yarn (install node and yarn) @ fb-quiz ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.863 s
[INFO] Finished at: 2018-09-13T21:32:27+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:install-node-and-yarn (install node and yarn) on project fb-quiz: The parameters 'yarnVersion' for goal com.github.eirslett:frontend-maven-plugin:1.6:install-node-and-yarn are missing or invalid -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginParameterException

The error is occurring after upgrading to jhipster v5.3.1

Motivation for or Use Case
Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s)
fb-quiz@0.0.0 D:\Projects\arif\fb-quiz
`-- generator-jhipster@5.3.1
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.creatives.apsstr"
    },
    "jhipsterVersion": "5.3.1",
    "applicationType": "monolith",
    "baseName": "FbQuiz",
    "packageName": "com.creatives.apsstr",
    "packageFolder": "com/creatives/apsstr",
    "serverPort": "8080",
    "authenticationType": "session",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "mysql",
    "prodDatabaseType": "mysql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "rememberMeKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "clientFramework": "angularX",
    "useSass": true,
    "clientPackageManager": "npm",
    "testFrameworks": [],
    "jhiPrefix": "apsstr",
    "enableTranslation": false
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
Environment and Tools

java version "1.8.0_144" Java(TM) SE Runtime Environment (build 1.8.0_144-b01) Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

git version 2.14.1.windows.1

node: v8.11.3

npm: 6.1.0

yarn: 1.7.0

Browsers and Operating System
ruddell commented 6 years ago

How did you upgrade? Based on your .yo-rc.json you are using npm as the package manager so there should be an npmVersion in your pom.xml (you can add yarnVersion as a quick workaround).

The default was recently changed from yarn to npm so maybe you missed something in the upgrade. I couldn't reproduce this

arabbani commented 6 years ago

I think this is the part that produces the error.

<build>
                <plugins>
                    <plugin>
                        <groupId>com.github.eirslett</groupId>
                        <artifactId>frontend-maven-plugin</artifactId>
                        <version>${frontend-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>install node and yarn</id>
                                <goals>
                                    <goal>install-node-and-yarn</goal>
                                </goals>
                                <configuration>
                                    <nodeVersion>${node.version}</nodeVersion>
                                    <yarnVersion>${yarn.version}</yarnVersion>
                                </configuration>
                            </execution>
                            <execution>
                                <id>webpack build dev</id>
                                <goals>
                                    <goal>yarn</goal>
                                </goals>
                                <phase>generate-resources</phase>
                                <configuration>
                                    <arguments>run webpack:build</arguments>
                                    <yarnInheritsProxyConfigFromMaven>false</yarnInheritsProxyConfigFromMaven>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>${maven-war-plugin.version}</version>
                        <configuration>
                            <failOnMissingWebXml>false</failOnMissingWebXml>
                            <warSourceDirectory>target/www/</warSourceDirectory>
                            <webResources>
                                <resource>
                                    <directory>src/main/webapp</directory>
                                    <includes>
                                        <include>WEB-INF/**</include>
                                    </includes>
                                </resource>
                            </webResources>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
ruddell commented 6 years ago

When you have npm as the clientPackageManager, it should not reference yarnVersion, see the sample-app for the correct config. You can copy that config to fix your issue.

I'm closing since it's not possible to generate that code with your .yo-rc.json, it seems to be an issue with your upgrade process (jhipster upgrade works as expected). Feel free to reopen if you find a way to reproduce the issue.

arabbani commented 6 years ago

It was indeed a problem with the upgrade process brother. What i did was that i had changed packageManager to 'npm' in v5.0.1, because yarn had some issue. So while upgrading maybe the generator found npm, and skips any modification if it would have found yarn instead