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.26k stars 870 forks source link

Build with Travis is not working #879

Open tlapeg07 opened 4 years ago

tlapeg07 commented 4 years ago

Hello,

First thank you for this plugin which looks very nice. I'm using it to build a project composed of several maven modules (Java, SpringBoot, Angular) and it works quite well localy. The problem is that it does not work on my Travis CI. I guess I'm not using it properly, but if you could help a bit it would be very nice.

My travis config looks like this :

language: java sudo: false dist: trusty jdk:

script:

Upload test coverage to codacy

env: global:

before_install:

after_success:

which gives the following error :

[INFO] Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/repos/central/data/com/github/eirslett/frontend-maven-plugin/1.9.1/frontend-maven-plugin-1.9.1.pom [WARNING] The POM for com.github.eirslett:frontend-maven-plugin:jar:1.9.1 is missing, no dependency information available [INFO] Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/repos/central/data/com/github/eirslett/frontend-maven-plugin/1.9.1/frontend-maven-plugin-1.9.1.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 13.253 s [INFO] Finished at: 2020-02-05T15:59:06Z [INFO] Final Memory: 49M/167M [INFO] ------------------------------------------------------------------------ [ERROR] Plugin com.github.eirslett:frontend-maven-plugin:1.9.1 or one of its dependencies could not be resolved: Could not find artifact com.github.eirslett:frontend-maven-plugin:jar:1.9.1 in google-maven-central (https://maven-central.storage-download.googleapis.com/repos/central/data/) -> [Help 1] [ERROR]

In the POM of the module that fails to compile I've the following :

<build>
    <plugins>
        <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <version>1.9.1</version>
            <configuration>
                <nodeVersion>v12.14.1</nodeVersion>
                <npmVersion>6.13.4</npmVersion>
                <workingDirectory>src/main/frontapp/</workingDirectory>
            </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>

                <execution>
                    <id>npm run build</id>
                    <goals>
                        <goal>npm</goal>
                    </goals>
                    <configuration>
                        <arguments>run build</arguments>
                    </configuration>
                </execution>

                <execution>
                    <id>prod</id>
                    <goals>
                        <goal>npm</goal>
                    </goals>
                    <configuration>
                        <arguments>run-script build</arguments>
                    </configuration>
                    <phase>generate-resources</phase>
                </execution>

            </executions>
        </plugin>
    </plugins>
</build>

With the same command (mvn clean install -DskipTests) it works well on my own windows.

Do you have an idea of the problem? Thank you !

Best regards,

eirslett commented 4 years ago

What is this? https://maven-central.storage-download.googleapis.com/ looks like it's a mirror in front of Maven Central? Which doesn't contain the artifact?

tlapeg07 commented 4 years ago

If it is a mirror, I do not know how to avoid it... But a mirror should have the same content anyway, no?

The only place where I'm calling your plugin is in the POM of the Angular module:

com.github.eirslett frontend-maven-plugin 1.9.1 v12.14.1 6.13.4 src/main/frontapp/ If there is something wrong with maven central or with a mirror or with the downloading itself, I could also add the jar directly as a local library. I've already tried, but it gives another error : [WARNING] The POM for com.github.eirslett:frontend-maven-plugin:jar:1.9.2-SNAPSHOT is missing, no dependency information available [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 12.547 s [INFO] Finished at: 2020-02-05T10:31:12Z [INFO] Final Memory: 55M/187M [INFO] ------------------------------------------------------------------------ [ERROR] Plugin com.github.eirslett:frontend-maven-plugin:1.9.2-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact com.github.eirslett:frontend-maven-plugin:jar:1.9.2-SNAPSHOT -> [Help 1] The best option would be to solve the maven-central/mirror issue, but otherwise, if you would gives the steps to build a proper jar, it would be very nice. Thank you anyway for the quick answer :)
Paulius11 commented 4 years ago

I'm getting similar error:

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.10.0:npm (npm build react) on project oms: Failed to run task: 'npm run build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

Repository: link

Is there any way to fix or skip this part of ./maven install? All suggestions are appreciated

eirslett commented 4 years ago

@Paulius11 your error is different. It says npm run build failed. Try running it directly on the command line, does it work then? Also try using the latest versions of Node.js and npm.

Paulius11 commented 4 years ago

@Paulius11 your error is different. It says npm run build failed. Try running it directly on the command line, does it work then? Also try using the latest versions of Node.js and npm.

Updated to latest node and npm versions. I tried to run: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V locally, it works fine. Any ideas why travis build might be failing?