cant' install sublimemaven plugin successfully - maven

I follow this https://coderwall.com/p/etesrq to install the sublimemaven plugin for my sublime2.
All steps seems ok, but I can't get the 'Maven' menu item in 'Tools->Build System'.
I have added the
"m2_home": "F:/jill/job/software/apache-maven-3.0.4",
add
"maven_menu_commands":
by following https://github.com/nlloyd/SublimeMaven.
and restart sublime2 several times.
but still can't get it.
Could some body help?
Thanks

I find that I don't have "maven" in "tools" -> "build system" either, but using cmd + shift + p , then type in "maven", I can see several commands, one of them is "maven: Run...", I use this command when I need to specify one. Commonly, other default maven commands could satisfy your requirement.

Nick Lloyd's SublimeMaven plug-in installed nicely for me on Sublime Text 3 but showed build commands only in the Command Palette (CTRL+SHIFT+P).
Only after I added Andres Koetter's configuration file to the Packages/User directory of my portable SUBLIME_TEXT_3/Data/ dir (or ~/.config/sublime-text-3/ for some) I found a Maven build option in the Tools > Build menu. This new option enables Sublime Text 3's build system run commands for Maven builds, that is:
Build (CTRL+B) : run default build configuration
Build with ... (CTRL+SHIFT+B) : select mvn goals, profiles, command-line options, etc.

Just adding a working directory tip that I found on this URL: https://gist.github.com/4ndrej/5162986
Once I finished instructions provided by user2951392, I got working Maven menu on sublime text 3. Then I tried to build some projects, but for each one of them I got an error like this: "...there is no pom.xml file on directory E:\sublime...".
So, just change the following content on Maven.sublime-build file:
old: "$file_path"
new: "${project_path:${folder}}"
With this final change I got my sublime text 3 and Maven 3+ working fine.
Cheers!

Related

Vscode with custom settings.xml Maven file per project in a workspace

I have a Vscode workspace with a bunch of Maven projects, and which one has its own Maven settings.xml file.
As each project has its own settings file with the same name but in its own root folder I got success configuring both the workspace as each of the projects with such an option: {"maven.executable.options": "-s my_settings.xml"}.
Although, I can run successfully any of Maven commands for all projects, Vscode reports problems in the pom.xml files about missing artifacts and the same errors are reported when I run tests from the "Testing" in the Side Bar.
When I copy one of the project's settings file to the ~/.m2/settings.xml that given project works fine, no errors at all.
So, I conclude Vscode doesn't respect the "maven.executable.options" for all of project operations inside IDE, like tests and maybe others operations but only for directly launched Maven commands.
I don't want to merge all those settings.xml files into a big one in my local ~/.m2/settgins.xml each time I have to open a given set of projects.
Is there a way to teach Vscode to use different settings.xml for each project and make it work properly in all Vscode operations (not only Maven commands)?
VSCode setting ID: java.configuration.maven.userSettings
In VSCode, go to Preferences > Settings > Workspace
Search 'maven'
Set 'Java > Configuration > Maven: User Settings' to ./settings.xml to make VSCode use the local settings.xml of the project
Restart VSCode if needed
Screenshot
you can use
mvn --settings settings.xml clean install
to individually point respective settings.xml for each java app
First, check whether the terminal executes the command "mvn ... -s my_settings.xml", which indicates the correctness of vscode-maven plugin. If so, the problem comes from the command itself.
A workaround is to delete the global maven settings.xml, typically in $MAVEN_HOME\conf\settings.xml. Then mvn ... -s my_settings.xml should work. It works fine for me.
The reason may be that when global maven settings file is found, mvn CLI may ignore the settings file in mvn option.

IntelliJ & Maven - mvn command not found

I'm trying to build a drop wizard project created with IntelliJ.
when I run
mvn package
I get
bash: mvn: command not found
I'm on a Mac and I'm following this tutorial: http://www.dropwizard.io/0.9.2/docs/getting-started.html
According to IntelliJ documentation (https://www.jetbrains.com/help/idea/2016.1/maven.html?origin=old_help)
Maven integration is shipped with IntelliJ IDEA, and you do not need to perform any additional actions to install it. You can start using it straight away for importing Maven projects, working with them and for running Maven goals.
So I don't know what I'm suppose to do in order to use the command line
Any idea?
Thanks
In IntelliJ, on the right hand side, click "Maven", and expand "Lifecycle"
Select "Package" and click "Run" (green arrow).
mvn is the command line tool for Maven.
See https://maven.apache.org/install.html for details on how to install it.
Or as you are using a Mac if you use brew try using it to install the maven formula.
If you have maven properly installed and you want to configure intelliJ terminal with a custom Terminal or if you want fix "command not found",
follow these steps:
Click > File
Click > Settings
Click > Tools
Click > Terminal
Edit "Shell path" # "Application Settings", if you use git bash change current path with:
C:\Users\Work\AppData\Local\Programs\Git\bin\sh.exe --login
// The path you may have differs based on your OS, in example: "installationPath\Terminal Folder\bin\sh.exe --login"
Click > Apply
Click > Ok
I used git bash but technically it should work with every terminal. Do not forget to add --login after the *.exe
If it still doesn't work maybe you need to check:
Click > Environment variables
Click > System Properties
Click > Environment Variables
Click > System Variables
Select > Path from the list
Click > Edit
Click > New
Insert the path of your maven bin folder, in example:
"installationPath\apache-maven-3.8.6\bin"
Also insert the path of your jdk, in example:
"installationPath\Java\jdk-18.0.1.1"

Jenkins plugin shows on Plugin page but does not show on configuration page

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.

Launching Ruby-Cucumber from IntelliJ (OSX)

I am in a new job and am using IntelliJ with Ruby and Cucumber.. all of which are new to me.
I have a working project based upon this project: https://github.com/jonathanchrisp/selenium-cucumber-ruby-kickstarter
So, from the command line, I run my project like this:
sudo cukesparse something
cukesparse is not my project but here is a quick description from github: "A simple command line parser to pass default and custom arguments into Cucumber with the power to define these as tasks in a config/tasks.yml file!"
(seems interesting enough to me)
So, from the command line I am able to execute this project without any problems. I am also able to "Build > Rebuild Project" without issue.
My question is regarding getting a Run Config to work. I have tried to go to Run > Edit Configurations, but have had no luck creating a config to start my run. When I try to click Ruby from the list of 'base configurations', IntelliJ doesn't seem to want me to pick it. The UI sort of doesn't respond.
I must be stuck with some obvious newbie booboo. Any tips greatly appreciated!
Which version of IntelliJ are you using? And do you have the Ruby and Base Cucumber plugins installed in IntelliJ? (From Intellij -> preferences -> Plugins). If not, the first step would be to install those.
Then you can create a run configuration by Run > Edit Configurations, selecting the required details. If you have further issues, a screengrab of your configuration (from Run > Edit Configurations) would be helpful.
I didn't ever get to the bottom of exactly what the issue was, but completely removing IntelliJ (using the comment from Jenny here: In IntelliJ on OS X, how do you clear out all global setting info, licensing etc. (external to any project)) and reinstalling with a very minimal plugin set fixed it. I basically only enabled the git plugin, then got the ruby plugin from the repository and no other plugins.
I did need to add the cucumber gem from the command line but that didn't turn out to be part of the problem. Something about the plugins I had selected was making some of the Run Configurations not function.

Maven ignores settings.xml file

I have added proxy configuration in settigns.xml file, but it is not used by Maven, i confirmed this by making the settings.xml file invalid. I ran the maven install command to update settings and global-settings to point to the correct file, still no luck. I am using maven3.0.4.
Try running Maven with the -X option. It should print as part of the debug output which settings file is being used.
Since you already tried it with an invalid file, I bet that something is wrong with the location of your file.
It's almost to stupid to tell, but it might save some time for somebody else: If you're using a new computer, make sure file extensions are displayed. Otherwise your "settings.xml" file probably is a "settings.xml.txt" file in fact...
Make sure it is in the right directory (HOME/.m2/settings.xml)
You can find the relevant paths and a proxy example here: Maven proxy settings not working
And of course the reference is always useful: https://maven.apache.org/settings.html
have you tried with these options: from the command line to specify the settings file?
mvn -o –Dmaven.repo.local=$HOME/.my_m2path/repository clean install --settings $HOME/.my_m2path/settings.xml Dcheckstyle.skip=true –DskipTests
Some options that might not be necessary
-o is for offline (unless you have all your repos in your m2, its suggested to skip this option)
skip tests is for skipping tests while building
–Dmaven.repo.local - repo path - if you are having own repo path, then use this option
--settings $HOME/.my_m2path/settings.xml (remember there is space between settings and the path)
Since there is no accepted answer, and I encountered that problem today and other answers proved unhlepful as the file path was correct:
The solution is to restart your computer. No, seriously. After restart maven is guaranteed to read settings.xml file again and use whatever changes you made.
For those using Linux
In the Ubuntu package repository (and probably other disto's too), there are two maven packages: maven and maven2. For some reason, I had maven2 installed, which seems to ignore settings.xml in ~/.m2.
As a solution, I removed it using
sudo apt-get purge maven2
and installed the other one with
sudo apt-get install maven
What's going on?
I couldn't find a reliable source, but apparently, maven2 is an older version (2.x), as the latest maven has version 3.x and is served with maven.
Please make sure you are using the settings.xml which you modified.
for example: your using IDE's embedded maven which using different settings.xml in you operation system.
You can set the path of settings file in Eclipse* as :
In the menubar goto Window -> Preferences
In Preferences Dialog, Goto Maven Section(On the left) and Expand it.
Click on UserSettings.
Add the path of settings file using Browse. The default for most users will be (C:\Users\.m2\settings.xml). It will be shown in grey but you need to actually enter the location.
Click on Update Settings !
You can also enable debug logs and stack traces for debugging by clicking on the Maven Section in the Preferences dialog and Checking the box against the label "Debug Output".
P.S. I am currently using Eclipse(Neon) on Windows 10 x64.
I have also been facing the same issue. I removed the file and folder, but still maven was still picking the settings.
For me, restarting the system solved the issue.
What I found was that even if I set my own maven setting file using the --settings or -s command such as:
mvn -s $MAVEN_HOME/libexec/conf/my-settings.xml clean
Maven was still reading the default global setting.xml
Two ways that one can slove this:
Rename the setting.xml to something like setting.xml.bak in the $MAVEN_HOME/conf dicrectory.
The preferred approach add global to the command -gs hence the final command becomes:
mvn -gs $MAVEN_HOME/libexec/conf/my-settings.xml clean

Resources