GithubHelp home page GithubHelp logo

microsoft / vscode-spring-initializr Goto Github PK

View Code? Open in Web Editor NEW
64.0 11.0 32.0 3.32 MB

VSCode Extension for Spring Initializr

License: Other

TypeScript 94.84% JavaScript 5.16%
spring-initializr spring-boot gitter microsoft vscode-extension java-support

vscode-spring-initializr's Introduction

Spring Initializr Java Support

Marketplace Version Installs Rating Gitter

Overview

Spring Initializr is a lightweight extension to quickly generate a Spring Boot project in Visual Studio Code (VS Code). It helps you to customize your projects with configurations and manage Spring Boot dependencies.

Screenshot

Feature List

  • Generate a Maven/Gradle Spring Boot project
  • Customize configurations for a new project (language, Java version, group id, artifact id, boot version and dependencies)
  • Search for dependencies
  • Quickstart with last settings
  • Edit Spring Boot dependencies of an existing Maven Spring Boot project

Requirements

  • VS Code (version 1.19.0 or later)
  • JDK (version 1.8.0 or later)

Install

Open VS Code and press F1 or Ctrl + Shift + P to open command palette, select Install Extension and type vscode-spring-initializr.

Or launch VS Code Quick Open (Ctrl + P), paste the following command, and press enter.

ext install vscode-spring-initializr

Use

  • Launch VS Code
  • Press Ctrl + Shift + P to open command palette.
  • Type Spring Initializr to start generating a Maven or Gradle project.
  • Follow the wizard.
  • Right click inside the pom.xml file and choose Edit starters for dependency refactoring. (Gradle project is not supported yet, PR is welcome for it.)

Configuration

  // Default language.
  "spring.initializr.defaultLanguage": "Java",

  // Default Java version.
  "spring.initializr.defaultJavaVersion": "11",

  // Default value for Artifact Id.
  "spring.initializr.defaultArtifactId": "demo",

  // Default value for Group Id.
  "spring.initializr.defaultGroupId": "com.example",

  // Spring Initializr Service URL(s). If more than one url is specified, it requires you to select one every time you create a project.
  "spring.initializr.serviceUrl": [ "https://start.spring.io" ],

  // Default value for Packaging. Supported values are "JAR" and "WAR".
  "spring.initializr.defaultPackaging": "JAR",

  // Default value for the method of openining the newly generated project. Supported values are "", "Open" and "Add to Workspace".
  "spring.initializr.defaultOpenProjectMethod": "Add to Workspace",

Feedback and Questions

You can find the full list of issues at Issue Tracker. You can submit a bug or feature suggestion, and participate community driven Gitter

License

This extension is licensed under MIT License.

Data/Telemetry

VS Code collects usage data and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more. If you don’t wish to send usage data to Microsoft, you can set the telemetry.enableTelemetry setting to false. Learn more in our FAQ.

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

vscode-spring-initializr's People

Contributors

boykoalex avatar brunovieira97 avatar craph avatar cscherryy avatar dependabot[bot] avatar eskibear avatar jdneo avatar leonardobsjr avatar matthew-dong avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar osmarcf avatar testforstephen 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-spring-initializr's Issues

Specify Spring Boot version bug in the initializr

Hi there!

I am not sure if it's a bug or not, I just installed Spring Boot Extension Pack and it's my first time using it.
The issue I am having is that I cannot pass the 'Specify Spring Boot version' when using Spring initializr.

Please see the gif below:

oct-16-2018 14-23-39

There is nothing said about it in the Configuration too:

screen shot 2018-10-16 at 2 26 06 pm

  1. Am I doing something wrong? What is the expected input?
  2. Is it a bug? If yes, how I should proceed about it as a user?

I would really appreciate any help with this, thank you in advance!

0.3.0 Endgame

Dev

  • Remove dependency of unzip package. @Eskibear
  • Support to edit starters for existing Spring Boot Maven projects. @Eskibear
  • Allow not to select extra dependencies when generate projects. @Eskibear

Test

  • 4/28 New feature test.
  • 5/2 Releasing test, following Test Plan

Release

  • 5/4 Update Readme & changelog
  • 5/4 Merge to master
  • 5/4 Trigger release job
  • 5/4 Add tag

Initializr Network Issues

As reported before here:
#84

I am having the same issue. I acknowledge this is not an extension bug, but I need to understand port / endpoints so I can request that the network paths are opened here at work.

First: VS Code is unable to fetch the avaliable Spring Versions as you can see here. It will sit and query forever without returning any versions.
springinit_error

Second: IF I use start.spring.io to create my project there and then try to open using visual studio code. I am unable to compile my Spring Boot project due to not being able to import the dependencies.

I was able to take my PC to a different network and download the dependencies, so things work now, but I will not be the first with this issue. Can you please provide the network credentials to the Spring.io sources that the extension uses? We can then request our company network firewall allows it.

Looking for [network path / ip] -- [port] -- [protocol] (ex: start.spring.io, 443, tcp) ??

Thanks

Proxy?!

This extension is not using my proxy settings.

[2018-03-30 15:30:11.474] [renderer1] [error] connect ETIMEDOUT 104.17.46.2:443: Error: connect ETIMEDOUT 104.17.46.2:443
	at Object.exports._errnoException (util.js:1050:11)
	at exports._exceptionWithHostPort (util.js:1073:20)
	at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1097:14)

mvnw missing execute permission

In MacOSX, file mvnw doesn't have execute permission. But if I downloads a zip from start.spring.io, and unzip if myself, it works well.

Edit Starts to ask less questions

At the end of the procedure, do not ask the users to 'Proceed'.

Suggested way:

  1. Open pom.xml and make it active
  2. Apply code changes to it WITHOUT saving

In this way, users are aware of the changes and can choose to Save or Cmd + Z

Spring Initializr generates .gitignore without /bin/

To reproduce the issue, just create a gradle project with Spring Initializr with latest Code.

Here is the .gitignore file:

HELP.md
.gradle
/build/
!gradle/wrapper/gradle-wrapper.jar

STS

.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

IntelliJ IDEA

.idea
*.iws
*.iml
*.ipr
/out/

NetBeans

/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

By default, it would be ideal to generate .gitignore file to exclude bin directory. Thanks.

An unknown error occured

Build used: build36

  1. Install the extension build
  2. Open VS Code without opening any folder.
  3. Open Command Palette, execute command Spring Initializr: Generate a Maven Project.
  4. Input a valid Group Id, press Enter.
  5. Input a valid Artifact Id, press Enter.
  6. Select a spring boot version

Error occurred:
image

Error occurs when creating a project to overwrite a different type of project

Environments

  • OS: Windows 10/OS X
  • VS Code version: 1.30.2
  • Extension version Build RC/2

To Reproduce
Steps to reproduce the behavior:

  1. Generate a Maven Project.
  2. Generate a Gradle Project with a same artifactId and folder.
  3. Then show a warning message:

  image

  1. Click continue button.
  2. See error.

Current behavior

  image

Expect behavior

  image

This issue also reproduce on previous version.

proxy problem

Extension doesn't seem to work behind a company proxy. Getting:
[2018-08-14 14:11:24.194] [renderer1] [error] connect ECONNREFUSED 104.17.46.2:80: Error: connect ECONNREFUSED 104.17.46.2:80
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)

Remember the groupid/artifactid between runs.

If i re-run the generation a number of times I am probably wanting to generate a series of related projects - likely with a common groupId, possibly with related artifactIds. It should remember what I used before and pre-populate the first 2 stages with that data (that I can edit).

0.2.0 Endgame

Dev

  • Allow user to select Spring Boot version #24
  • Allow to specify default group/artifact Id #28
  • Allow configuration of service endpoint #29
  • Add User-Agent header for requests #25
  • Improve dependencies filtering #26 ( keywords not supported, now filter name and description )
  • Update Extension Icon @Matthew-Dong #48

Test

Release

  • 2/9 Update Readme & changelog #48
  • 2/9 Merge to master
  • 2/9 Trigger release job
  • 2/9 Add tag

Failed to build after removing a dependency

Steps to reproduce:

  1. Generate a maven project , select some dependencies.
    e.g. Select "DevTools"and "Security" dependencies.
  2. Open pom.xml file, right click on the editing area of the file, choose Edit starters.
  3. In the QuickPick box, unselect "Security", and proceed following the prompt messages.
  4. mvn package

image

Command to expose 'Edit Starters' functionality

'Edit Starters' is an essential feature. The current entry of this functionality is hard to find - open pom.xml and right click.

A command needs to be added to VS Code - Spring Initializr: Edit Starters
The target pom.xml can be in different status. And here are some common scenarios:

  1. A pom.xml is opened and active - work with that file directly
  2. A project has only one pom.xml - work with that file directly
  3. A project has more than one pom.xml - list all the pom files with hierarchical representation, let user choose one
  4. Regarding 2 and 3, when the active editor is NOT a pom.xml, open the target file and make it active

Failed to build after removing security dependency

  1. Generate a maven project , select "Security" dependency.
  2. Open pom.xml file, verify current value of dependencies node.
  3. Right click on the editing area of the file, choose Edit starters.
  4. In the QuickPick box, unselect "Security", and proceed following the prompt messages.
  5. mvn package
    image

Cannot read property 'id' of undefined

Build used: build38

  1. Open VS Code without opening any folder.
  2. Open Command Palette, execute command Spring Initializr: Generate a Maven Project.
  3. Input a valid Group Id, press Enter.
  4. Input a valid Artifact Id, press Enter.
  5. Then show the spring boot version view, Press Esc

image

Support Edit Starters for gradle project

I'd like Edit Starters command to support gradle projects. It appears to only support maven projects (searches for pom.xml) files. It says it works by clicking on build.gradle and running Edit Starters, but I don't believe it works.

I think the gradle language server could help in this regard. I posted a question to their repository to ask them about it. It seems like the parsing of gradle files is something that we wouldn't want to just do a search and replace on. It seems like it would be straightforward based upon the dependencies that it pulls down. i.e. we'd need to map runtime -> runtimeOnly, compile -> compileOnly, etc. and handle the toRemove and to Add by appropriately.

How should it decide to handle the maven or gradle project? Should we only look for build.gradle if pom.xml can't be found? We could change the error msg to cannot find pom.xml or build.gradle. If it finds build.gradle, we'll use the language server to remove unwanted dependencies and add needed ones.

Is this something we can implement?

Error "Cannot read property 'fsPath' of null"

This error occurs when debugging the extension.
It's caused by inconsistency. If the user cancel the selection of the target folder, the wrapper returns null instead of undefined.

Unable to 'edit starters' in child project

I am unable to use the 'edit starters' feature from inside the pom of the child project.

Steps:
Created a spring boot project via Spring Initializr
Opened pom -> right click -> Edit starters

Error:
Fail to edit starters. Error: Not a valid Spring Boot project.

VScode version: 1.31.0-insider
Spring Initializr version: 0.4.4

Note: I am able to do this from the parent project pom, but it does not work from the child project pom

Please avoid node dependency to "natives" module

Hi,

I am a developer on VSCode and wanted to reach out to inform you that this extension is either using or having a dependency to a node module "natives" that will soon no longer be supported in VSCode once we updated to node.js 8.x (as part of our Electron 2.0 update which is planned for the near term).

The full graph is:

It would be great if this dependency could be avoided by either not depending on it anymore or updating the dependencies to newer versions so that this module is no longer pulled in.

As soon as any code in your extension (including node_modules) calls require("natives") we will throw an exception to prevent this module from getting loaded.

If this is just a devDependency and the module is never loaded in production, then you can ignore this issue and just close it!

More details in microsoft/vscode#47569

Thanks!
Ben
VSCode Team

Create a folder named after the artifactId

Currently, when VS Code generates a project, it simply drops the files in the selected folder. Ideally, a new folder (with the same name as artifactId) should be created in the selected folder.

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.