Expand my Community achievements bar.

SOLVED

Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:install-node-and-yarn (install node and yarn) on project wm.ui.frontend : Could not download Yarn: Could not download https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn-v1.22

Avatar

Level 2

Hi Team 

getting this error while running the mvn cmd
 mvn -PautoInstallPackage -Padobe-public install -DskipTests

have installed node, yarn, mvn. help on this ASAP.


Spoiler
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:00 min
[INFO] Finished at: 2024-09-16T08:54:21+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 wm.ui.frontend
: Could not download Yarn: Could not download https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn-v1.22.19.tar.gz: sun.security.validato
r.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path
to requested target -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :wm.ui.frontend





Thanks and Regards
Siva Thanu M S

1 Accepted Solution

Avatar

Correct answer by
Level 2

Hi all

Please note, It is resolved by installing the yarn using volta. I was trying to install yarn from cmd prompt using yarn install cmd so due to mismatch version it was getting this error, when I tried to install it yarn again using Volta it got the particular version of yarn installed without any error 

thanks all for the support

View solution in original post

12 Replies

Avatar

Community Advisor

Hi @Siva_Thanu_M_S,
Try the below command once- 

mvn clean install -PautoInstallPackage -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true 


Hope this helps!

 

Avatar

Level 2

Hi @Rohan_Garg 
Is it ok to do run -Dmaven.wagon.http.ssl.insecure=true, as it  it does not verify the SSL certificate of the server. idea on this.

Avatar

Community Advisor

Ideally no, but if it works then maybe you will have to import the certificate from the request URL.

For now, I just want to see if it is the certificate issue which is causing the error.

Let me know if this works!

Avatar

Community Advisor

Can you try mvn clean install -Dhttps.protocols=TLSv1.2 ?

Source - https://github.com/eirslett/frontend-maven-plugin/issues/696


Also, please share a copy of your pom.xml

Avatar

Level 2

Hi @Rohan_Garg 
the cmd mvn clean install -Dhttps.protocols=TLSv1.2 is not working getting the same error shared the maven front end plugin
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
<configuration>
<node.version>v20.12.2</node.version>
<npm.version>10.2.3</npm.version>
<yarn.version>v1.22.19</yarn.version>
</configuration>
<executions>
<execution>
<id>install node and yarn</id>
<goals>
<goal>install-node-and-yarn</goal>
</goals>
</execution>
<execution>
<id>yarn install</id>
<goals>
<goal>yarn</goal>
</goals>
</execution>
</executions>
</plugin>

Avatar

Community Advisor

There have been fair bit of issues when trying to install yarn from GitHub.

https://github.com/eirslett/frontend-maven-plugin/issues/562

https://github.com/eirslett/frontend-maven-plugin/issues/709

Can you try couple of things mentioned below?

  1. Removing ~/m2/repository/com/github/eirslett and build again with version 1.6.

  2. Updating to the latest version of yarn v1.22.22
  3. use the below with added ignore.validity.dates
    -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true

If nothing works would then have to explore at downloading the certificate, adding the certificate to keystore and then using -Djavax.net.ssl.trustStore=C:\<path\to\store>

Avatar

Community Advisor

HI @Siva_Thanu_M_S ,


Few things that you can check:

1. Version of "frontend-maven-plugin" use the latest one.

 

 2. Check if npm install" step is available in your pom. This code should be ran before your npm run dev or npm run prod.

   sample:

<plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>${frontend-maven-plugin.version}</version>
                    <configuration>
                        <nodeVersion>v12.22.7</nodeVersion>
                        <npmVersion>6.14.0</npmVersion>
                    </configuration>
                    <executions>
                        <execution>
                            <id>install node and npm</id>
                            <goals>
                                <goal>install-node-and-npm</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>npm install</id>
                            <goals>
                                <goal>npm</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

 

3. If you are using corp. proxy in maven settings.xml, check if it is set up correctly, maybe the proxy doesn't have an opening to   download from https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn-v1.22.19.tar.gz:, try to hit this URL directly and see   if you are able to download.

 Sample proxy configuration would look something like below:

  <proxy>  
       <id>xxx-proxy</id>  
        <active>true</active>    
        <protocol>http</protocol>     
        <host>proxy.xxx</host>
        <port>8080</port>
        <nonProxyHosts>*.xxx</nonProxyHosts>
  </proxy>

 

 

-Tarun

 

 

Avatar

Level 2

Hi @TarunKumar 
I m using yarn not npm, in which the yarn is already installed and node everything are in the updated version only. still getting this error help on this.

Avatar

Level 9

It is difficult to point you to a solution since we are missing a lot of details like Java version, AEM version, source code in question, etc.

A few things I would suggest checking:

  • Are you using the correct Java version for the AEM version you are trying to build?
  • If you are running the build via terminal, check where your JAVA_HOME environment variable points to.
  • If you are running the build via IDE, check which Java version you use to run the program. In IntelliJ check the Project SDK settings.
  • Try to replace the "%JAVA_HOME%/jre/lib/security/cacerts" file with the new one from the freshly installed JRE
  • Use your browser to export the certificate and then use keytool to save the certificate to Java's keystore:

    keytool -trustcacerts -keystore "%JAVA_HOME%jre\lib\security\cacerts" -storepass changeit -importcert -alias <alias_name> -file <path_to_crt_file>

 

Hops this helps, good luck,

Daniel

Avatar

Administrator

@Siva_Thanu_M_S Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni

Avatar

Correct answer by
Level 2

Hi all

Please note, It is resolved by installing the yarn using volta. I was trying to install yarn from cmd prompt using yarn install cmd so due to mismatch version it was getting this error, when I tried to install it yarn again using Volta it got the particular version of yarn installed without any error 

thanks all for the support