GithubHelp home page GithubHelp logo

microsoft / vscode-maven Goto Github PK

View Code? Open in Web Editor NEW
178.0 18.0 87.0 18.66 MB

VSCode extension "Maven for Java"

Home Page: https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-maven

License: Other

TypeScript 75.30% JavaScript 15.18% Java 9.52%
vscode-extension maven microsoft java-support

vscode-maven's People

Contributors

943297456 avatar andxu avatar apupier avatar balloonio avatar cscherryy avatar darrenparkinson avatar dependabot[bot] avatar doggy8088 avatar duncankwilliams avatar emliunix avatar eskibear avatar gustavosimon avatar jdneo avatar jeffgbutler avatar johanhammar avatar jridgewell avatar mannixsuo avatar microsoft-github-policy-service[bot] avatar or-geva avatar owenconti avatar robertderose avatar runxinxu avatar shihanmeng618 avatar si9ma avatar testforstephen avatar thccorni avatar tonjohn avatar trek-boldly-go avatar xqzlgy2 avatar zhengjun003 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-maven's Issues

When opening vscode Maven Projects take about 11 seconds to appear

Describe the bug
When opening vscode Maven Projects take about 11 seconds to appear.

To Reproduce

  • Root directory has 16 directories.
  • 8 subdirectories have pom.xml files.
  1. Restart vscode.
  2. Expand Maven Projects.
  3. Start timer until projects appear.

Expected behavior
Would a second or two be acceptable?

Environments (please complete the following information as much as possible):

  • OS: OS X
  • VS Code version: Version 1.26.0-insider (1.26.0-insider)
  • Extension version vscjava.vscode-maven-0.9.2

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

0.5.1 Endgame

Dev

  • 2/7 Code change #6
  • CRLF issue in commandHistory.txt #10

Test

Release

  • 2/9 Update Readme.md, changelog.md
  • 2/9 Merge to master branch
  • 2/9 Trigger CI job
  • 2/9 Add tag

Show/Add/Remove dependencies

Inside the explorer view, list the dependencies and allow add/upgrade/remove operations.
This is requested by the users while @yaohaizh already had some changes made at language server side. Please check where the best place for such feature is.

Searching for Maven Projects throws "No whitespace between attributes Line: 0 Column: 105 Char: x"

Hi,

I've opened a folder which have previously successfully built with Maven and run through Eclipse.

When scanning the folder for Maven projects I get:
"No whitespace between attributes Line: 0 Column: 105 Char: x"

I've tried a fresh clone so the workspace is clean and I get the same result. I've also tried setting the Maven path in my VS Code User settings.

I'm using Windows 10.

Help please.

Support the setting of 'maven.executable.path' in vscode workspace folder settings

Describe the bug
Open a multi-root workspace with multiple maven projects, I want one of the projects to use its own mvnw file and others use the environment maven path. But when I search using 'maven' keyword in specified folder settings, there are only two maven settings and I can't find 'maven.executable.path'

To Reproduce

  1. Open a muitl-root worksapce
  2. Open folder settings to choose a project and search maven related settings

Environments (please complete the following information as much as possible):

  • OS: Windows 10/OS X
  • VS Code version: 1.25.1
  • Extension version 0.9.2

Screenshots
image

v0.10.0 Plan

  • Hide Maven view by default #51 ( completed in PR #80 )
  • ~~~Improve user experience for editing pom.xml #47~~~ (Moved to next version)
  • Create separate terminals for each root folder #68 ( completed with PR #83 )
  • Force to use mvnw if found. #84 ( PR #88 ) add a config to turn on/off (#105 )
  • Refactor maven projects explorer ( completed with PR #83 )
  • Improve performance of searching for pom.xml #77 ( completed with PR #83 )
  • Includes archetypes in local catalog when generating projects. #82 (completed with PR #86 )
  • Refactor maven command history. (completed with PR #87 )

Maven projects don't open correctly using "File -> Open Workspace..."

If I open a folder containing a multi-module Maven project (well ... all my projects are multi-module), VS Code correctly parses the POM files and sets up the classpath. If I then save the environment as a workspace I should, in theory, be able to load that environment using "Open Workspace...". Instead VS Code seems to be missing some part of the previous workspace's configuration. It's pretty common for the classpath to be incomplete - clicking on some files results in a notification indicating that my Java file isn't on the classpath so only syntax checking will be performed. I originally noticed this because if the classpath doesn't include a test class, running the tests from the test explorer results in an error pop-up that says "Reduce of empty array with no initial value"

The saved workspace doesn't have anything surprising in it - though I'll admit I don't know what it should look like. Since it's very small, here is the contents of that file:

{
	"folders": [
		{
			"path": "/home/smoyer1/git/selesy/hibp-client"
		}
	],
	"settings": {
		"java.configuration.updateBuildConfiguration": "automatic"
	}
}

I'm using:

  • VS Code version 1.21.1
  • Maven for Java version v0.6.0
  • mvn -version returns:
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-116-generic", arch: "amd64", family: "unix"

maven.archetype.generate command issue

I am new to maven but have been having issues with version 3.5.3, when I was on 3.5.2 the plugin worked perfectly but every-since I upgraded with brew to 3.5.3 the maven plugin in vscode shows me this: command 'maven.archetype.generate' not found. I know that if i use man archetype:generate it will work with the terminal, but its the plugin that wont work. I made sure to route where my maven path is in settings in vs studio just in case.. path: /usr/local/Cellar/maven/3.5.3/libexec. its where i had it with version 3.5.2, I just changed it to 3.5.3: anyway, let me know if you can help with this issue. would be glad to have the plugin working rather than keep getting command 'maven.archetype.generate' not found

Existing terminals don't apply new nvironment variables.

Steps:

  1. Open a maven project
  2. Execute a maven goal, e.g. clean, it launches an integrated terminal.
  3. Update maven.terminal.customEnv in settings.
    "maven.terminal.customEnv": [
        {
            "environmentVariable": "testName",
            "value": "testValue"
        }
    ] 
    
  4. In the terminal, verify the env, it's not set.

根据pom.xml创建.classpath&.project文件需要多次重启VSCode

我因错误修改了.classpath,导致项目无法运行。
接下来,我把.classpath以及.project删除了。
然后重启。vscode会根据pom.xml生成.classpath跟.project文件
但是重启,仅仅生成了.project文件。
第二次打开的时候。生成了.vscode\launch.test.json。并没有生成.classpath文件。
第三次打开会生成.classpath但是无法运行我的单元测试.
第四打开就完全可以了。

windows 10 use bash terminal

I use bash (windows subsystem) as default terminal, compile maven project will be error:

mvn -f "d:\workspace\lts-core\pom.xml" compile
wsh@WSH-T303UA:/mnt/d/workspace$ mvn -f "d:\workspace\lts-core\pom.xml" compile
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-readable POM /mnt/d/workspace/d:\workspace\lts-core\pom.xml: /mnt/d/workspace/d:\workspace\lts-core\pom.xml (No such file or directory) @
@

use this command will be correct:
mvn -f "/mnt/d/workspace/lts-core/pom.xml" compile

Please be compatible with bash.

Locally installed archetypes not detected

Installing an archetype and updating the local-catalog to contain said archetype does not cause it to appear in the list of available archetypes from the Maven: Generate from Maven Archetype command. I have verified that my archetype is correctly installed by cat'ng the local-catalog as well as generating a project using the archetype from the command line.

OS: Debian Stretch

Current working directory is wrong when pom.xml is in subdirectory of root

Describe the bug
The current working directory is wrong when pom.xml is in subdirectory of root. This causes path issues when executing a spring-boot:run command. Can you cd over to the directory of the pom.xml as default behavior?

As a comparison, when you execute a maven goal in Intellij it defaults the working directory to the same directory as the pom.xml file.

Better experience of generating projects

When generating projects from archetypes, users have to know exactly what archetype to use. But Maven central does not have a good mechanism for users to discover what's best for their needs. Download numbers are hidden so we cannot tell how popular one package is. The whole experience is frustrating.

Suggest improving the experience by providing a better recommendation mechanism for users to find archetypes. We actually can maintain a list of download numbers initiated from our extension and do recommendation based on that. This is only one way to consider.

The recommendation can also apply to all the scenarios when users look for dependencies.

Error Couldn't find a compatible version of Maven for Java

When trying to install the plugin, the following message always appears

Couldn't find a compatible version of Maven for Java with this version of Code.

I downgraded my maven from version 3.5.3 to 3.5.2 but didn't help.

Has anyone having the same issue?

Save Custom Goals

My default workflow is to run "clean install". To do this I have to do the following things

  1. Open the command prompt and navigate to "Maven: Run Goal"

  2. Select Project

  3. Either a) Select the custom goal from history OR b) select custom goal and write it again

It would benefit me to have a way to save off custom goals in a way that they are treated as "first class citizens" IE accessed in a way similar or identical to the standard goals ("install, deploy") are

0.7.0 Endgame

Dev

  • Refer to the Plan
  • Update popular archetype list

Test (with new features)

Release

  • 4/12 Update Readme.md, changelog.md
  • 4/12 Merge to master branch
  • 4/12 Trigger CI job
  • 4/12 Add tag

0.6.0 Endgame

Dev

  • Update tree view when pom.xml is created/modified/deleted. (for #13 )
  • Add telemetry to know popular archetype. (for #20 )

Test

Release

  • 3/16 Update Readme.md, changelog.md
  • 3/16 Merge to master branch
  • 3/16 Trigger CI job
  • 3/16 Add tag

0.7.0 Plan

New features

  • Support to set JAVA_HOME from java.home in extension redhat.java, and add extra environment variables before execute maven commands in terminal. @jeffgbutler

  • Support to put popular archetypes ahead according to collected anonymous data. @Eskibear

  • Allow to append default options for mvn commands #14 @Eskibear

Allow to append default options for mvn commands

Originally raised at Eskibear/vscode-maven#41 by @blassmegod .

Would be nice to have a flag to enable or disable the online use of maven, so that it can cut down on network usage (mvn -o).

Current workaround:

For the moment you have a workaround by running custom goals, adding -o manually for your commonly used commands.


usage: mvn [options] [<goal(s)>] [<phase(s)>]

Possible solution to specify default options in settings.

e.g.

{
    "maven.defaultOptions": "-O -q"
}

Command clean will finally trigger:

mvn -f <pom.xml path> -O -q clean

FAQ Guidance error pop-up when set maven.executable.path to mvnw.cmd

Describe the bug
Set value of maven.executable.path to mvnw/mvnw.cmd path and save, get below error.
But in fact, for the maven wrapper, we can succefully execute maven command .

To Reproduce

  1. Open project todo-app-java-on-azure in vscode
  2. set "maven.executable.path" to mvnw/mvnw.cmd path and save

Expected behavior
No error.

Environments :

  • OS: Windows 10/Linux/OS X
  • VS Code version: 1.24.1
  • Extension version 0.9.0 (build #234)

Screenshots
image

image

Error:Illegal argument null

Build: 251

Repro steps:

  1. F1, execute command "Generate from maven archetype"
  2. Select destination folder
  3. Select an archetype

Results:
Error in toggle developer tools:
image

Custom settings.xml

I can't find where should I set my custom settings.xml per project. This is the usage of mvn -s option.

Could this be implemented project-wide?

Hide Maven view by default

Maven Projects view should hide if the project isn't Maven-enabled. I added when to the package.json :

		"views": {
			"explorer": [
				{
					"id": "mavenProjects",
					"name": "Maven Projects",
					"when": "workspaceContains:pom.xml"
				}

which succeeds in hiding when I don't have a Maven project, but doesn't show in the view contributions list when I load my Java project containing a pom.xml.

Maven goal from context menu gets executed in other projects terminal

Describe the bug
I have a workspace with multiple maven projects. When I have a terminal open in project A, and I wish to run a maven goal in project B, I use the context menu over the "Maven projects" side window and click the desired goal. A new maven terminal windows open in the root of project A to run maven in project B.

adrian@MY-LAPTOP:~/projects/my-project-A$ "./mvnw" clean -f "/home/adrian/projects/my-project-B/pom.xml"
While the thing work, it's confusing that the terminal ends up open in the other project's directory.

To Reproduce
Steps to reproduce the behavior:

  1. Add two maven projects to a workspace.
  2. Open an integrated terminal in project A.
  3. Right click on project B in the maven projects list and run clean goal.
  4. You end up with the clean goal for project B ran from the root directory of project A.

Expected behavior
I expected the maven terminal to be open in the root of the actual project I'm running the goal for.

Environments (please complete the following information as much as possible):

  • OS: Linux Ubuntu 16.04
  • VS Code version: 1.25.0
  • Extension version: 0.9.0

Error occurred in generating effective pom file

Build: 145

  1. Specify java.home in user settings:
    "java.home": "C:\\Program Files\\Java\\jdk1.8.0_161"
  2. Add following entry in user settings:
    "maven.terminal.useJavaHome": true
  3. Generate Effective POM file

RESULT:
image

Setting maven command to "./mvnw" works, but it shows an error on startup

Describe the bug
I have my settings like this, to use the maven wrapper that comes from start.spring.io projects:
"maven.executable.path": "./mvnw",

This works smoothly, but after upgrading to last release, because of the new validation, I get:

Unable to execute Maven commands.
Error:
Command failed: "./mvnw" --version
/bin/sh: 1: ./mvnw: not found

To Reproduce
Steps to reproduce the behavior:

  1. Set the maven executable path to "./mvnw"
  2. Close and Open vscode.

Expected behavior
I know the goal for the plugin is to support maven and not the maven wrapper, but I think it's commonly used, so I would like to see if there is a valid workaround or if maybe the command for validation "./mvnw" --version could be run in the project's root.

Thoughts?

Support for mvnDebug

Hi,

Is there any support for using mvnDebug instead of mvn? At present I have just added the following setting to use mvnDebug from my PATH.

"maven.executable.path": "mvnDebug"

Not sure if there is a downside of this?

Use case is that I want to be able to use the jetty-maven-plugin and debug my servlet code. So I run mvnDebug jetty:run and then I can attach the vscode debugger.

Thanks
Chris

Improve pom.xml editing experience

  1. Better auto-completion
    • a. Show dependency candidate list as users type
    • b. Show version candidate list as users type
  2. Code snippet
    • a. Code snippet for dependency
    • b. Code snippet for properties
  3. Syntax highlighting - color logical nodes differently
  4. Error check
    • a. Check compatibility errors between dependencies

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.