frontend-maven-plugin icon indicating copy to clipboard operation
frontend-maven-plugin copied to clipboard

I don't know why it was detected as x86_32 and then tried to download node-v12.16.1-linux-x86.tar.gz and found 404 How to solve it? thank you

Open manbanpan opened this issue 4 years ago • 12 comments
trafficstars

[INFO] os.detected.name: linux [INFO] os.detected.arch: x86_32 [INFO] os.detected.version: 3.10 [INFO] os.detected.version.major: 3 [INFO] os.detected.version.minor: 10 [INFO] os.detected.release: centos [INFO] os.detected.release.version: 7 [INFO] os.detected.release.like.centos: true [INFO] os.detected.release.like.rhel: true [INFO] os.detected.release.like.fedora: true [INFO] os.detected.classifier: linux-x86_32

[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ ui-ngx --- [INFO] [INFO] --- frontend-maven-plugin:1.7.5:install-node-and-yarn (install node and npm) @ ui-ngx --- [INFO] Installing node version v12.16.1 [INFO] Downloading https://nodejs.org/dist/v12.16.1/node-v12.16.1-linux-x86.tar.gz to /root/.m2/repository/com/github/eirslett/node/12.16.1/node-12.16.1-linux-x86.tar.gz [INFO] No proxies configured [INFO] No proxy was configured, downloading directly

[INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.7.5:install-node-and-yarn (install node and npm) on project ui-ngx: Could not download Node.js: Got error code 404 from the server. -> [Help 1]

Pom file <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>org.ospthings</groupId> 3.1.1 <artifactId>ospthings</artifactId> <groupId>org.ospthings</groupId> <artifactId>ui-ngx</artifactId> jar

<name>OSPThings Server UI</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <main.dir>${basedir}/..</main.dir>
</properties>

<build>
    <resources>
        <resource>
            <directory>${project.build.directory}/generated-resources</directory>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <version>1.12.0</version>
            <configuration>
                <installDirectory>target</installDirectory>
                <workingDirectory>${basedir}</workingDirectory>
            </configuration>
            <executions>
                <execution>
                    <id>install node and npm</id>
                    <goals>
                        <goal>install-node-and-yarn</goal>
                    </goals>
                    <configuration>
                        <nodeVersion>v12.16.1</nodeVersion>
                        <yarnVersion>v1.22.4</yarnVersion>
                      <!-- optional: where to download node from. Defaults to https://nodejs.org/dist/ -->
                      <!-- <nodeDownloadRoot>http://npm.taobao.org/mirrors/node/</nodeDownloadRoot> -->
                      <!-- optional: where to download yarn from. Defaults to https://github.com/yarnpkg/yarn/releases/download/ -->
                      <yarnDownloadRoot>http://npm.taobao.org/mirrors/yarn/</yarnDownloadRoot>
                    </configuration>
                </execution>
                <execution>
                    <id>yarn install</id>
                    <goals>
                        <goal>yarn</goal>
                    </goals>
                    <configuration>
                        <arguments>install</arguments>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
<profiles>
    <profile>
        <id>yarn-build</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>1.12.0</version>
                    <configuration>
                        <installDirectory>target</installDirectory>
                        <workingDirectory>${basedir}</workingDirectory>
                    </configuration>
                    <executions>
                        <execution>
                            <id>yarn build</id>
                            <goals>
                                <goal>yarn</goal>
                            </goals>
                            <configuration>
                                <arguments>run build:prod</arguments>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
    <profile>
        <id>yarn-start</id>
        <activation>
            <property>
                <name>yarn-start</name>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>1.12.0</version>
                    <configuration>
                        <installDirectory>target</installDirectory>
                        <workingDirectory>${basedir}</workingDirectory>
                    </configuration>
                    <executions>
                        <execution>
                            <id>yarn start</id>
                            <goals>
                                <goal>yarn</goal>
                            </goals>
                            <configuration>
                                <arguments>start</arguments>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

manbanpan avatar Jun 07 '21 10:06 manbanpan

Do you run on a 32 bit computer? Is it some sort of IoT device, or a really old laptop?

eirslett avatar Jun 07 '21 22:06 eirslett

The application is automatically deployed to the container cloud, the system is linux/arm64, how can it detect x86_32?

manbanpan avatar Jun 08 '21 00:06 manbanpan

How do I specify the files to download?

manbanpan avatar Jun 08 '21 00:06 manbanpan

You can see in your test output: [INFO] os.detected.arch: x86_32 Maybe you need to upgrade your Maven version, Java version and the version of this plugin. I have no idea why it's guessing the wrong arch.

eirslett avatar Jun 08 '21 13:06 eirslett

mvn -v Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T19:49:05Z) Maven home: /opt/apache-maven-3.5.3 Java version: 1.8.0_232, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.i386/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.10.0-693.el7.x86_64", arch: "i386", family: "unix"

arch x86_64

Execute mvn-v command to display i386, Execute the arch command to display x86_64. Which is correct?

manbanpan avatar Jun 10 '21 05:06 manbanpan

Looks correct to me! So there's probably a bug in the code that reads environment data to guess the right architecture. You can find in it the file called Platform.java.

eirslett avatar Jun 10 '21 21:06 eirslett

Same error, ¿any update?

cesarjanuario82 avatar Nov 23 '21 15:11 cesarjanuario82

Same error, is there any way to specify arch as x64 to avoid the miss detection? It's so annoying.

Kuanlin-Chen avatar Dec 15 '21 08:12 Kuanlin-Chen

Both commands are executed before the package command is executed.  export JAVA_HOME=/usr/lib/jvm/java-openjdk export JRE_HOME=$JAVA_HOME/jre

发自我的iPhone

------------------ Original ------------------ From: Corey @.> Date: Wed,Dec 15,2021 4:34 PM To: eirslett/frontend-maven-plugin @.> Cc: 搬运工 @.>, Author @.> Subject: Re: [eirslett/frontend-maven-plugin] I don't know why it was detectedas x86_32 and then tried to download node-v12.16.1-linux-x86.tar.gz and found404 How to solve it? thank you (#977)

Same error, is there any way to specify arch as x64 to avoid the miss detection? It's so annoying.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

manbanpan avatar Dec 15 '21 08:12 manbanpan

Both commands are executed before the package command is executed.  export JAVA_HOME=/usr/lib/jvm/java-openjdk export JRE_HOME=$JAVA_HOME/jre 发自我的iPhone ------------------ Original ------------------ From: Corey @.> Date: Wed,Dec 15,2021 4:34 PM To: eirslett/frontend-maven-plugin @.> Cc: 搬运工 @.>, Author @.> Subject: Re: [eirslett/frontend-maven-plugin] I don't know why it was detectedas x86_32 and then tried to download node-v12.16.1-linux-x86.tar.gz and found404 How to solve it? thank you (#977) Same error, is there any way to specify arch as x64 to avoid the miss detection? It's so annoying. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

It works! You definitely save my life, thanks!

To be clear, my OS is Ubuntu 18.04 x64 and I used Oracle JDK 1.8 to run mvn install in the beginning, it will cause a miss detection os.detected.arch: x86_32. After I export JAVA_HOME to OpenJDK 8, it resolved the issue, os.detected.arch will become x86_64, which is correct.

Kuanlin-Chen avatar Dec 15 '21 09:12 Kuanlin-Chen

Both commands are executed before the package command is executed. export JAVA_HOME=/usr/lib/jvm/java-openjdk export JRE_HOME=$JAVA_HOME/jre 发自我的iPhone ------------------ Original ------------------ From: Corey @.> Date: Wed,Dec 15,2021 4:34 PM To: eirslett/frontend-maven-plugin _@**._> Cc: 搬运工 _@.>, Author @.**_> Subject: Re: [eirslett/frontend-maven-plugin] I don't know why it was detectedas x86_32 and then tried to download node-v12.16.1-linux-x86.tar.gz and found404 How to solve it? thank you (#977) Same error, is there any way to specify arch as x64 to avoid the miss detection? It's so annoying. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

It works! You definitely save my life, thanks!

To be clear, my OS is Ubuntu 18.04 x64 and I used Oracle JDK 1.8 to run mvn install in the beginning, it will cause a miss detection os.detected.arch: x86_32. After I export JAVA_HOME to OpenJDK 8, it resolved the issue, os.detected.arch will become x86_64, which is correct.

Update the information, I miss-installed a 32bit Java on my computer, so it might not relevant to OpenJDK or Oracle JDK, this command helped me to troubleshoot the issue: java -d64 -version or java -d32 -version.

In addition, os.arch is not the bitness of the OS, but the JVM.

Kuanlin-Chen avatar Dec 16 '21 03:12 Kuanlin-Chen

Dropping this here in case it helps anybody else who stumbled on this. If you need to hardcode the architecture for some reason (you need Java to be on 32bit but Node on 64bit for example), you can use the set-system-properties plugin before execution of the frontend-maven-plugin : https://github.com/mojohaus/properties-maven-plugin just specify the os.arch property to match whatever value you need from here: https://github.com/eirslett/frontend-maven-plugin/blob/master/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/Platform.java#L8

floverfelt avatar Mar 24 '22 15:03 floverfelt