GithubHelp home page GithubHelp logo

alexfalappa / nb-springboot Goto Github PK

View Code? Open in Web Editor NEW
157.0 16.0 42.0 1.71 MB

NetBeans IDE plugin supporting programming with Spring Boot

License: Apache License 2.0

Java 96.82% HTML 2.04% Lex 1.14%
netbeans-plugin spring-boot spring-data spring-mvc spring netbeans-ide netbeans

nb-springboot's Introduction

NB-SpringBoot

NetBeans IDE plugin supporting programming with Spring Boot.

Requirements and Installation

This plugin requires NetBeans 8.2 or above running on JDK 8 or above.

To perform a manual install download the desired nbm package from the releases page , go to Tools > Plugins > Downloaded and click the Add Plugins... button. Choose the downloaded nbm package file then click Install.

The plugin may be available in the Plugin Portal Update Center thus it can be downloaded and installed trough Tools > Plugins > Available Plugins. Please note that new releases become available on the Update Center after they are verified by the folks at the NetBeans Plugin Portal. Note that current NetBeans Plugin Portal (http://plugins.netbeans.org) is undergoing migration at Apache Foundation. A new plugin portal is being set-up (currently at http://netbeans-vm.apache.org/pluginportal but subject to change) and may become the new official source of plugins.

Features

  • Spring Boot Maven project wizards:
  • Specific editor for configuration properties files with:
    • extended syntax highlighting (dot separated keys, array notation)
    • error highlighting for: syntax errors, duplicate properties, data type mismatches and unknown properties
    • quick fixes for: removing deprecated, unknown and duplicate properties or substituting deprecated properties with their replacement
    • completion and documentation of configuration properties names and values (with support of hint value providers defined in configuration metadata)
  • Java editor error highlighting and fixes for missing starter dependencies:
    • @ConfigurationProperties annotation without spring-boot-configuration-processor dependency
    • Imports of Spring MVC annotations and Spring Data interfaces without relevant starter dependencies (e.g. JpaRepository without spring-boot-starter-data-jpa dependency)
  • Code templates:
    • Java templates for web request mapping annotations, WebFlux router functions and CommandLineRunner beans
    • Configuration properties templates for commonly used sets of properties
  • Spring Boot file templates:
    • CommandlineRunner classes
    • ApplicationRunner classes
    • application.properties files
    • additional-spring-configuration-metadata.json files
    • @ConfigurationProperties annotated classes
  • Spring Boot Actuator file templates:
    • Actuator endpoints
    • Classes implementing InfoContributor
    • Classes implementing HealthIndicator
  • Additional Spring Framework file templates:
    • @Component annotated classes
    • @Configuration annotated classes
    • @Service annotated classes
    • @Controller annotated classes (Spring MVC)
    • @RestController annotated classes (Spring MVC)
    • Reactive @RestController annotated classes (Spring WebFlux)
    • Reactive handler classes (Spring WebFlux)
    • Interfaces extending Repository both imperative and reactive (Spring Data)
  • Additional code generators in pom.xml files:
    • Add Spring Boot dependencies (dependency metadata is taken from the Spring Initializr web service)
    • Add basic Spring Boot setup
  • Toolbar button to trigger Spring Boot devtools reload
  • Custom Spring Boot project properties page to:
    • Specify command line run arguments and launch VM options
    • Enable/disable manual devtools reload trigger
    • Toggle debug mode and color output
    • Assisted override of configuration properties at launch
  • Additional navigator panel to show request URL mappings of a Controller / RestController class

Issues and Documentation

Bug tracking: GitHub Issues

Getting Started: Quick Tour

Reference: GitHub Wiki

License

The plugin and its source code are licensed under Apache 2.0 license.

Acknowledgements

Completion of Spring Boot configuration properties feature is based on Keevosh plugin.

Templates and code generators were inspired by those found on Spring Boot Tools 4 NetBeans.

Requestmappings navigator panel feature contributed by Michael Simons.

Badge on projects icon feature initially contributed by Hector Espert.

Changelog

See the separate file

nb-springboot's People

Contributors

alebruno avatar alexfalappa avatar blackleg avatar dependabot[bot] avatar didiez avatar graben avatar hectorespert avatar markiewb avatar michael-simons avatar sworisbreathing 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

nb-springboot's Issues

Configuration Editor: navigation

Navigation (ctrl + click) from property names to corresponding setter methods of @ConfigurationProperties annotated class (stsourceType metadata field)

Basic configuration properties editor

Specialized editor for Spring Boot configuration properties exploiting metadata generated by the spring configuration processor and stored in spring-configuration-metadata.json or additional-spring-configuration-metadata.json files.
Features:

  • Completion of configuration properties names with substring property name search
  • Documentation showing metadata description field
    • Descriptions of values in lists of allowed values
    • Indication of deprecation
    • Indication of deprecation reason
    • Indication of replacement property name
  • Completion of configuration properties values (hints values)
  • Documentation of configuration properties values

Test

Problem

Something is wrong

Overview description

Steps to reproduce

  1. sd sdfg
  2. sdfg cxb
  3. rterthert

Actual results

Expected results

Visual enhancements

Custom icons in the Project view for:

  • SpringBoot projects
  • application.properties and application-<profile>.properties files

Templates for SpringBoot related files

File templates for:

  • application properties files (application.properties and application-<profile>.properties
  • metadata files (additional-spring-configuration-metadata.json)
  • CommandLineRunner implementations
  • ApplicationRunner implementations

Advanced configuration properties editor

Improvement of the specialized editor for Spring Boot configuration properties deeply exploiting metadata generated by the spring configuration processor.
Features:

  • Preselect or place first in list the default value in value completion list
  • Editor Hint (light bulb) at top of file for indication of missing spring configuration processor dependency in maven pom.xml file
  • Editor Hint (light bulb) for substitution of deprecated properties names with intended replacement
  • Editor Hint (light bulb) for creation of metadata for new properties names in `additional-spring-configuration-metadata.json' file (creating it the first time)
  • Navigation (Ctrl + click) from property names to corresponding setter methods of @ConfigurationProperties annotated class (sourceType metadata field)
  • Alternate navigation (Shift + Ctrl + click) from property names to corresponding metadata block in `additional-spring-configuration-metadata.json' file
  • Error highlighting of bad data type property values
  • Support for properties that map to collections:
    • Array notation (square brackets in keys)
    • Map keys and values
  • Support for ValueProviders (even multiple)
    • any provider
    • java enum reference
    • java class reference
    • spring bean reference
    • spring profile reference
    • logger name
    • handle as locale
    • handle as charset
    • handle as mimetype
    • handle as resource (filesystem or classpath)

Configuration metadata JSON editor

Specialized editor for additional-spring-configuration-metadata.json files.
Features:

  • Completion based on configuration metadata structure
  • Completion of values

No location proposal for application.properties file template

The new file wizard for application.properties files should not ask for a location, only the file name, and create it directly in src/main/resources.

It would be ideal to ask for a profile name and generate the corresponding application-<profile_name>.properties file.

Configuration Editor: editor hints

Hints (light bulb) for:

  • missing spring configuration processor dependency in maven pom.xml file
  • substitution of deprecated property names with their replacements
  • creation of metadata for current property name in additional-spring-configuration-metadata.json file

Respect project license

When using the templates for repositories, controllers and other stereotypes, I expect them to respect the license configured under project settings.

This only works if I select one of the "Build in" global licenses, but not if I check "Use project location".

Avoid implementation dependencies in POM code generators

Avoid implementation dependencies needed for the maven pom.xml code generators by using Yenta which allow to make the plugin a friend of other modules at runtime.

Implementation dependencies are hard to maintain cause require recompilation to adapt to new netbeans platform versions.

It seems that they also prevent the plugin to be verified and thus be available by default in NetBeans plugin manager from the plugin portal.

Improve the RESTController template

The RestController class template should have a RequestMapping annotation on the main type and some methods with annotations for GET, POST, PUT and DELETE verbs

Improve request mapping navigator panel

The navigator panel table could see some improvements:

  • Use an ETable from swing.outline module. This should bring sorting, column auto resize and visibility toggle.
  • Consider not to show the package when the types are different (i.e. method(String, Integer) instead of method(java.lang.String, java.lang.Integer) but method(java.util.Timestamp, java.sql.Timestamp)
  • Add custom cell renderers to bring some color

New image and thumbnail for Plugin portal

The thumbnail and bigger image are at present not coordinated (spring boot logo and screenshot patchwork).

Make a good screenshot composite and a reduced resolution version for the thumbnail.

No proposal for Spring additional metadata JSON file

The new file template for spring-configuration-additional-metadata.json file should not ask for a file name and should automatically create it in src/main/resources/META-INF directory.

The wizard could ask for the sections to create (properties, hints/values, hints/providers).

Specialized SpringBoot project type

A merger of the standard Maven application project and Maven webapp project supporting:

  • New project property page to specify main class and application arguments (with completion of configuration properties?): at the moment when run/debug trough maven plugin is active the standard run page is disabled.
  • New project property page to enable/disable reload trough trigger file (also see #19)
  • Node for web resources (static and templates)

This should also allow to set custom project icons as mentioned in #8.

New project wizard for basic SpringBoot application

Add to the new project wizard (File > New Project) a template for a basic Spring Boot application.
Such an application should be a minimal Spring Boot maven application.

New project wizard categoriy: Maven

Enhance new repository template

The new repository wizard could allow to specify the base interface to extend:

  • Plain Repository
  • CrudRepository
  • JpaRepository

It could also allow to specify the class parameters for the id and entity.
Ideally it could derive the id class when the entity class is selected.

Devtools not working when project run trough spring maven plugin

According to documentation to make dev tools work the spring maven plugin must be configured as follows:

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <fork>true</fork>
            </configuration>
        </plugin>
    </plugins>
</build>

Web resources node

One or two nodes in the project view for web resources showing the content of src/main/resources/static and src/main/resources/templates folders

New project wizard for SpringBoot application from Initializr webservice

Add to the new project wizard (File > New Project) an item for creating a Spring Boot application by interacting with the Spring Initializr web service (http://start.spring.io).

The wizard should:

  1. query the service for parameters metadata
  2. build an ui for specifying creation parameters
  3. collect user chosen parameters
  4. invoke the service
  5. download and unpack the project archive
  6. open the resulting project

Upgrade to Spring Boot 1.4

The new release of Spring Boot, currently in release candidate phase, is due by the end of the month.

Improve the Controller template

The template of a Controller class should have a method with a RequestMapping Annotation and at least a ModelParameter, returning a string (view name)

Templates for Spring related files

File templates for:

  • Spring service classes (@Service annotated)
  • Spring configuration classes (@Configuration annotated)
  • Spring component classes (@Component annotated)
  • Spring Data repositories classes
  • Spring MVC controller classes (@Controller annotated)
  • Spring MVC rest controller classes (@RestController annotated)

Improve Initializr project wizard

The Initializr Spring Boot project wizard should:

  • Move spring boot version combo box in the dependencies choosing page
  • Reflow long dependency descriptions in tooltips on two or more rows
  • Show required boot version range in tool tips of disabled dependencies checkbox
  • Add an option to remove the generated maven wrapper files and directory
  • Add an option to configure running/debugging of the project trough the spring boot maven plugin
  • Validate package textfield, preventing choosing an invalid Java package identifier
  • Add an option to add the spring configuration processor to the pom.xml as a dependency recommending it in the wizard
  • Allow to filter dependencies trough a search textfield
  • Asyncronously perform network requests (see https://performance.netbeans.org/responsiveness/improving/postinit_of_comps.html)

Restart trigger action shortcut conflict

The restart action shortcut (Ctrl + Shift + L) in NetBeans 8.2 conflicts with the newly inroduced Paste as Lines command related to editor multicaret.

The shortcut could be changed considering the action rename mentioned in #40.

Rename reload action

The Spring Boot documentation speaks of application restart when referring to class change detection and reload while reload is referred to automatic web browser page refresh when resources change.

Change the action name into Spring Boot Restart

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.