how to set requirejs plugin in maven - maven

I move my project from ubuntu to windows, and the requirejs plugin not work!
I just change the nodejs path
<nodeExecutable>C:/Program Files/nodejs/node</nodeExecutable>
And the maven return this
[ERROR] Failed to execute goal com.github.mcheely:requirejs-maven-plugin:2.0.0:o
ptimize (default) on project interactBack: r.js exited with an error. -> [Help 1
]
I have test my project by cmd , and it works fun!
node r.js -o app.build.js
What's the problem?

I get the answer!
As is said by the author
nodeExecutable
An optional path to a nodejs executable. This should not be needed if node is in
the system path as 'node' or 'nodejs';
So, just delete the tag.

Related

Cannot invoke "java.io.File.isFile()" because "this.inputFile" is null

I met a problem when trying to build Quickfixj Project on Windows 10.
I tried the command using Git:
$ mvn clean package -Dmaven.javadoc.skip=true -DskipTests -PskipBundlePlugin
and it returned error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:3.4.2:single (bin-assembly) on project quickfixj-distribution: Execution bin-assembly of goal org.apache.maven.plugins:maven-assembly-plugin:3.4.2:single failed: Cannot invoke "java.io.File.isFile()" because "this.inputFile" is null -
I've never met such problem and I searched online but no relevant solutions were found.
Shall I reinstall maven or other solutions recommended? Thanks!
This seems to be a bug with the QuickFIX/J build process.
If you omit -PskipBundlePlugin the build will succeed.
I had the same problem for me with mac m1, on vscode;
I just changed the version in the pom.xml file to:
maven-assembly-plugin-version>3.1.0</maven-assembly-plugin-version
and it worked for me.
in addition to that I Installed some apache extension for vscode.

Jhipster project runs fine on Mac, but fails to run on Linux

I have a JHipster project that includes Spring Boot and React Native. I run it OK using ./mvnw as the guide specifies, however, when I put the entire project on Ubuntu, it fails to run and the log is as follows:
ERROR Failed to execute goal
com.github.eirslett:frontend-maven-plugin:1.8.0:npm (webpack build dev)
on project galley-1: Failed to run task: 'npm run webpack:build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.8.0:npm (webpack build dev)
Some points to note are that: I use sudo, and I already changed the webpack space size to be as big as 9000, in package.json.
Just to answer my own question, I finally find a way to run this:
On mac, I package my project using 'mvn -Pprod package -DskipTests' (sorry there were some tests that didn't pass at that time, I didn't get time to fix those at that time), and then on Linux:
nohup sudo java -jar *.jar &
It will do the trick. But if anyone gets any better idea, please share.

Error: Could not find or load main class org.gradle.launcher.GradleMain

I'm new to Gradle and while trying to install Gradle in my PC with Windows OS, I got the below mentioned error
Error: Could not find or load main class org.gradle.launcher.GradleMain
Only thing I did is that I followed the gradle installation steps given in gradle site Gradle installation and typed
gradle -v
in command prompt and I got the above mentioned exception. Any clue as to what had happened and how to resolve it.
This is what I have done :
Downloaded the zip file
Copied 'gradle-3.5' from the zip file to a folder I created in C drive (C:\Gradle)
Set GRADLE_HOME to 'C:\Gradle\gradle-3.5'
Set Path to '%GRADLE_HOME%\bin'
Opened cmd and typed gradle -v and got this error
I stopped all gradle daemons by running ./gradlew --stop and the error was resolved for me.
Basically this means that Gradle can't find your gradle/wrapper/gradle-wrapper.jar.
You have to follow Step 3 and setup environment variables:
Microsoft Windows users
In File Explorer right-click on the This PC (or Computer) icon, then
click Properties -> Advanced System Settings -> Environmental
Variables.
Under System Variables select Path, then click Edit. Add an entry for
C:\Gradle\gradle-3.5\bin. Click OK to save.
Source: https://gradle.org/install#configure
The easiest way, is to simply use gradlew.bat in your project and it will auto download Gradle for you!
I had the same issue after I removed the cache, the Gradle worker was running and I was getting this error
Error: Could not find or load main class worker.org.gradle.process.internal.worker.GradleWorkerMain
Steps I performed to resolve the error
Use gradle --stop or ./gradlew --stop
Delete the workerMain.lock file under $USER/.gradle/caches/version/workerMain
re-run the Gradle command

Go CI does not recognize build file for gradle

I have setup GO CI pipeline for continuous integration in my project. I tried to add a project that is built using gradle. I tried a add gradle task for building my application.
While executing build it shows that
FAILURE: Build failed with an exception.
* What went wrong:
Task 'build' not found in root project 'Gradlepipelinejob'.
I tried to add defaultTasks 'clean', 'compile' to the parent build.gradle file. But still the same error exists. Someone pls help me in resolving this issue.
I think 'build' should be in Command section, rather than arguments. Even after that if it doesn't works, try executing build commands in the agent terminal(or any command prompt).This will let you figure out whether the error is in server or agent.
GO CI runs the command in the code checkout directory so please check if your gradle file is present or not in that directory

Jenkins executing maven from incorrect path

This happens for both: maven projects, and freestyle projects, when maven target is envoked, it tries to execute mvn using absolute path.
[MY-Job] $ tools/Maven/Jenkins_Private_Maven/bin/mvn -f cc/pom.xml -Ddeploy_env=xxx.dev.prv -Dbranch=dev -D-Dsmdist.target=/opt/builds -U clean test -DtestGroups=unit,delegate -Do verride:server=xxx.dev.prv
FATAL: command execution failed
java.io.IOException: Cannot run program "tools/Maven/Jenkins_Private_Maven/bin/mvn" (in directory "workspace/MY-Job"): java.io.IOException: error=2, No such file or directory
I can see that mvn is installed at user's home :
/home/jenkins/tools/Maven/Jenkins_Private_Maven/bin/mvn
but it's trying to run it from the workspace:
/home/jenkins/workspace/MY-Job/tools/Maven/Jenkins_Private_Maven/bin/mvn
Add the default maven installation under (Jenkins -> configuration)
Goto the failing job and make sure you choose the default maven installation from dropdown
Run the job. Success!
Are you sure you have set up Maven in Jenkins -> configuration like this
I have hunch you have a accidental **"."** current directory reference somewhere in your maven set up.
This looks like an auto installed Maven by Jenkins. In which case the previous answers are not correct.
It would seem in this occasion that you have not specified a "remote fs root" for your slave in the salve setup - later versions of Jenkins flag not setting this up correctly as an error.
in Jenkins 2.43:
Manage Jenkins -> Global Tool Configuration -> Maven

Resources