I have a docker environment with was in Windows 11, when I install the mvn in IntelliJ IDEA it throws me:
"The parameters 'wasHome' for goal com.orctom.mojo:was-maven-plugin:1.0.8:deploy are missing or invalid"
enter image description here
enter image description here
I edit the ${wasHome} in the EAR in pom.xml
/opt/IBM/WebSphere/AppServer
but I have to make that modification in each project, ideally it should not be done that way. since for that the environment variables are configured in the IntelliJ IDEA.
Related
I run my Spring Boot project from the command line using mvn install and then mvn spring-boot:run -Dspring.profiles.active="development". This works fine but is not very convenient. I would like to start it directly from Intellij by clicking the green run button.
I tried to add a new run configuration but without success. I set "main class" and "active profiles" and tried to add "run maven goal" but the last one does not work (when I choose the working directory - the one with pom.xml - it says Maven projects not found). What should I exactly set up ? I just want to run the two commands mentioned above from the root directory of the project.
Update: here is the project structure project structure
Please follow the following steps:
Set the maven goal by clicking the "+" in IntelliJ (circled area)
Write mvn install.
Set the VM Options as: -Dspring.profiles.active=development
After that it should just run fine just by clicking the green play button.
This should help you get started.
I have latest version of Apache Maven 3.3.9 residing in my drive downloaded from here. I need it for configuring Appium tool to perform automated testing of Android applications. I have Maven plugin already configured with my Eclipse IDE. I went through few articles and got to know that I have to configure Maven into system variables as well. I set system variables, path for it as below.
M2HOME = C:\Program Files (x86)\Apache\apache-maven-3.3.9
M2 = %M2HOME%\bin
path = C:\Program Files\Java\jdk1.8.0_31\bin;%M2%
I tried running mvn , mvn -version from cmd prompt to check successful configuration of Maven but it gave me nothing. I tried navigating to the bin folder and re run the command but still the result is same. I even changed my path variable to have absolute path of Apache Maven i.e path = C:\Program Files (x86)\Apache\apache-maven-3.3.9\bin
To be further sure I copied the Apache Maven to a different folder just because it had spaces in between Program Files and Program Files (x86) but still the command prompt is as below:
I had followed above steps referring various articles in google. I'm not getting if I have committed any unseen mistake.
P.S: I have even tried above commands with cmd running as an administrator
Try mvn --version (with two dashes). mvn -v should also work. If Maven is not being executed at all, I suggest you try mvn.bat.
Some Command Prompt configurations will refuse to run .bat-files without the extension unless you explicitly tell them to.
It's probably a good idea to run where mvn in your Command Prompt as well. You should get this:
<YOUR_MAVEN_HOME>\bin\mvn
<YOUR_MAVEN_HOME>\bin\mvn.bat
<YOUR_MAVEN_HOME>\bin\mvn.cmd
if everything it set up correctly.
You should define M2_HOME variable. (Not M2HOME). Make sure it looks like this:
You said that you copied your maven to the location without spaces. That's a good idea. But it looks like your Path system variable points to the old location of maven. Make sure to change it. (What is the current location of maven?)
BTW mvn -version works as well as mvn --version
I have a windows jenkins slave and I have download apache-maven-3.3.3 on it.
It is located C:\Users\myUsername\Desktop\apache-maven-3.3.3 This is copy and pasted from the windows explorer on my Windows slave.
Then when I point at this location in Jenkins and run a build. I get this error
Couldn’t find any executable in C:\Users\myUsername\Desktop\apache-maven-3.3.3
I have also tried Couldn’t find any executable in C:\Users\myUsername\Desktop\apache-maven-3.3.3\bin
This works just fine on my linux slaves. What is the difference? Why is this not working?
Maven changed the name of the executable in Maven 3.3 from mvn.bat to mvn.cmd. Jenkins recognized mvn.cmd since Jenkins 1.613 (see this commit). If you are on an earlier Jenkins version you can add a symlink from mvn.bat to mvn.cmd on windows as a workaround.
The executable is in the \bin folder (namely, mvn.bat). Try to point Jenkins to C:\Users\myUsername\Desktop\apache-maven-3.3.3\bin
First
Under your Windows machine
1. create an Environment Virable named MAVEN_HOME and set its value to C:\Users\myUsername\Desktop\apache-maven-3.3.3.
2. Add %MAVEN_HOME%\bin into your System PATH
Second
Go to
http://your-jenkins-server/computer/your-windows-slave/configure -->Node Properties-->Tool Locations-->(Maven)maven
and set its value to C:\Users\myUsername\Desktop\apache-maven-3.3.3 as well.
Third
Reconnect your jenkins slave, then rerun your job.
Well for me it was wrong setting for maven. Go to configure, under post build action, go to advanced setting and there fix the Maven version to be used, i changed it to maven 3.3.3 and it worked.
I am using Windows. The accepted answers does not work for me. So, I have to create a new Maven in Jenkins and select the option "Install automatically". Then it works.
I am creating a hello world plugin for Jenkins by following Tutorial: Create a Jenkins Plugin to integrate Jenkins and Nexus Repository. After I followed the steps, I can run Jenkins and test the plugin.
It shows on Installed Plugin Page.
Then I go to Configuration page and expect to see Hello World Builder section like the below image, but there is not.
What steps did I miss? Is there anything I have to do before having that plugin show up on the configuration page?
Update
This is the project layout, I haven't modified anything on it yet.
What command did you use to generate the plugin skeleton?
FYI, from the tutorial above, mvn -cpu is deprecated.
To generate the plugin skeleton, use:
mvn hpi:create
or
mvn -U org.jenkins-ci.tools:maven-hpi-plugin:create from the Jenkins Plugin tutorial
I'm going to include each step for what worked for me:
mvn hpi:create, then enter groupId (press enter to use default: org.jenkins-ci.plugins) and artifactId (name of the plugin)
cd new-plugin-name
mvn eclipse:eclipse
mvn package
mvn hpi:run
(default port is 8080, but you can set your own with Dport option (i.e. mvn hpi:run -Dport=9999, use this if port 8080 is in use - otherwise mvn hpi:run will fail)
Open browser and enter URL "localhost:8080" (or 9999)
You should the page below. Click the link and that'll take you to Jenkins home page
Click 'Manage Jenkins' > Configure System. Scroll down near the bottom of the page and you should see the Hello World Builder section
Go back to Jenkins home page and click New Item
Give the project any name, select Freestyle Project, click OK.
Scroll down to the Build section and click 'Add build step' > Say hello world
Enter a name (i.e. TestName), save the project, then run a build ('Build Now')
Click on the latest build under 'Build History' > Console Output.
I had a same problem and solved it.
I am sure you are using eclipse as IDE and imported HelloWorldBuilder as a maven project.
In my case, I converted it to eclipse project after deleted and regenerated again.
Please refer "Setting up a productive environment with you IDE" section of the following url and use this command.
mvn -DdownloadSources=true -DdownloadJavadocs=true -DoutputDirectory=target/eclipse-classes -Declipse.workspace=/path/to/workspace eclipse:eclipse eclipse:add-maven-repo
https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial
If you launch the project after convert and rebuild it, the hello world builder section will be shown in your jenkins configuration menu.
I recently had the same problem. Apparently currently (see date of this message) master of the hello world example is wrong. I needed to change
<artifactId>hello-world</artifactId>
to
<artifactId>hello_world</artifactId>
because some component in the middle doesn't accept "-". I think hpi:create will tell you that, unfortunately the debug log files don't. But the existing hello-world should already have those things correct.
Even I faced same problem, I think reason is because I imported to eclipse as a maven project. I deleted folder and ran command
mvn -U org.jenkins-ci.tools:maven-hpi-plugin:create
to create new project. Then ran mvn hpi:run and it showed up well.
I am using a computer with Windows 7, and I have Hudson installed on it. I have had this installation for a while, and it has been working fine up till now.
Something has changed. Now, whenever I try to build a project, after successfully checking out the project from SVN, it fails with this message:
ERROR: M2_HOME is set to an invalid directory.
M2_HOME = "C:\Build\Hudson\.hudson\jobs\Score_Plugin\workspace\.."
Please set the M2_HOME variable in your environment to match the
location of the Maven installation
I cannot figure out why it is giving me this error. Why is Hudson trying to find M2_HOME in its own workspace? I tried the following, which seems to say that my Maven installation in my environment is just fine:
1. I opened up a CMD and typed in `where mvn` and got the following:
C:\Build\Maven\apache-maven-3.0.5\bin\mvn
C:\Build\Maven\apache-maven-3.0.5\bin\mvn
2. I typed in `mvn -version` and got this:
Apache Maven 3.0.5 <r01de14724cdef164cd33c7c82fe155faf9602da; 2013-02-19 05:51:28-0800>
Maven home: C:\Build\Maven\apache-maven-3.0.5
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: C:\Build\Java\jdk1.7.0_25_x64\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
3. I checked to see, and I have a `MAVEN_HOME` environment variable set to `C:\Build\Maven\apache-maven-3.0.5`.I also have `%MAVEN_HOME%\bin` in my path.
It looks like my environment is working.
4. In an attempt to solve this error, I created a M2_HOME environment variable and set it equal to %MAVEN_HOME%.
5. To top it all off, I've rebooted my machine.
I'm still getting this error. I'm getting it for every project I try to build in Hudson. I'm not sure what I else I can do. Any ideas?
My understanding is that %M2_HOME% is the home of the local Maven repository as opposed to %MAVEN_HOME% which is the Maven installation directory.
From memory, I think the local Maven repository on Windows is in C:\Documents and Settings\User\.m2\ but I've been Linux through-and-through for a few years now so I may be wrong.
Check for this local repository folder and try setting the variable to there instead.
I am not sure why this worked, but it did.
As suggested by sbk's comment, I went to the build configuration. I clicked "advanced" to look for the `Use private Maven repository` option.
I expected to see this option selected as it would explain the problem. But it wasn't. I didn't expect it would help, but I selected the option anyway just to see what would happen:
Amazingly, it worked! My project builds again in Hudson. I still don't know what caused this problem in the first place, or why this fixed it, but since it did this is the answer for me unless someone else can explain why this worked.
I was getting same error. Earlier my directory was C:\apache-maven-3.0.4\apache-maven-3.0.4\bin
I renamed the folder structure as C:\maven\apache-maven-3.0.4\bin
Also updated the system variable accordingly