vscode-maven icon indicating copy to clipboard operation
vscode-maven copied to clipboard

can not automatically add a dependency whose type is pom

Open ShihanMeng618 opened this issue 3 years ago • 1 comments

Describe the bug can not automatically add a dependency whose type is not jar, the default value.

To Reproduce Steps to reproduce the behavior:

  1. Run add a dependency command
  2. Search for takari-plugin-integration-testing and add, which is a pom dependency
  3. See error in pom.xml

Expected behavior support other types of dependencies

Environments:

  • OS: Windows 10
  • VS Code version: 1.58.1
  • Extension version: 0.31.0

Screenshots image

ShihanMeng618 avatar Jul 16 '21 06:07 ShihanMeng618

both addDependency and setDependencyVersion only support dependencies whose type is jar. So we need to fix them separately.

  1. for addDependency: get type from getArtifacts(), and change the construction of dependencies node in pom.xml
  2. for setDependencyVersion: add -DshowTypes in maven command, add type in class Dependency and change related functions.

ShihanMeng618 avatar Sep 01 '21 05:09 ShihanMeng618