Code Monkey home page Code Monkey logo

vertx-starter's Introduction

Vertx.x Starter

Build Status

Vert.x Starter is an open-source web application for creating Vert.x applications.

Quickstart

Simply click on Generate Project on the web interface to download a project archive.

If you are a CLI adept, you can use any http client (curl, httpie) to invoke the API.

curl -G https://start.vertx.io/starter.zip \
  -d "groupId=com.example" \
  -d "language=java" \
  --output starter.zip

API

Generating a Vert.x application

https://start.vertx.io/starter.{archiveFormat}
Note
archiveFormat can be zip, tgz, tar.gz, etc. if the project generator can handle the format, it will use the appropriate compression tool.

You can provide the following query parameters to customize the project:

  • Basic information for the generated project groupId, artifactId

  • language: java or kotlin

  • buildTool: maven or gradle build tool

  • vertxVersion: the Vert.x version

  • vertxDependencies: a comma separated list of artifactIds of the vert.x modules

  • packageName: code package name, derived from groupId and artifactId by default

  • jdkVersion: which version of the JDK to use, defaults to 11

Full example:

curl -G https://start.vertx.io/starter.zip \
  -d "groupId=com.example" \
  -d "artifactId=starter" \
  -d "language=java" \
  -d "buildTool=maven" \
  -d "vertxDependencies=vertx-web,vertx-web-client"
  --output starter.zip

The HTTPie equivalent:

http https://start.vertx.io/starter.zip \
  groupId==com.example \
  artitfactId==starter \
  language==java \
  buildTool==maven \
  vertxDependencies==vertx-web,vertx-web-client \
  -o starter.zip

Vert.x Starter metadata

The vert.x starter metadata lists all the capabilities proposed by the API. The metadata is used to build the Web UI is exposed to ease the creation of third-party clients (IDE integration, CLI, etc).

https://start.vertx.io/metadata

Running your own starter

Building fat jar

In order to build it, you will need Java 17.

./mvnw clean package -DskipTests

Running the app locally

# Configure analytics dir
export VERTX_STARTER_ANALYTICS_DIR=target
# Build frontend first
./mvnw clean process-resources
# Run backend in redeploy mode
./mvnw compile vertx:run -Dskip.npm

Running frontend in development mode

cd src/main/frontend
npm run dev
Note
The frontend development server expects the backend to listen on localhost port 8080.

Releasing

Note
The following commands assume you have forked the project and upstream is the vert-x3/vertx-starter remote repository.

To release the project, proceed as follows.

First, tag the last commit in master branch:

STARTER_VERSION=$(./mvnw org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version -B | grep -v '\[')
git tag -f -a ${STARTER_VERSION} -m "Version ${STARTER_VERSION}"
git push upstream  --tags

Close the corresponding milestone on GitHub.

Then merge the master branch into the prod branch:

git checkout prod
git pull
git merge master
git push

GitHub Deploy job will automatically redeploy the starter if the prod branch build passes.

Eventually, checkout master again and update the version:

git checkout master
./mvnw versions:set -DgenerateBackupPoms=false
git add pom.xml
git commit -s
git push upstream && git push

License

Vert.x Starter is Open Source software released under the Apache 2.0 license.

vertx-starter's People

Contributors

aguibert avatar anguisa avatar brunolellis avatar danielpetisme avatar dependabot[bot] avatar frangarcia avatar gmariotti avatar hanasakari avatar jeanpic avatar jponge avatar matthudsonatx avatar okou19900722 avatar oliver-brm avatar ondrejvalenta avatar pk-work avatar pmlopes avatar rdruss avatar reistiago avatar richardf avatar ruslansennov avatar slinkydeveloper avatar tsegismont avatar vietj avatar wowselim avatar yanwenkun 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

Watchers

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

vertx-starter's Issues

Not able to add more dependencies after adding one

Version

Vertx version 3.5.3

  • vert.x starter:

Context

I encountered an exception which looks suspicious while adding more dependencies after adding one.

Do you have a reproducer?

No

  • Link to github project/gist

Steps to reproduce

Browser used: Chrome

  1. Open http://start.vertx.io/
  2. Add Version, Language, Build, GroupId, ArtifactId
  3. Add a dependency, say Vertx.x Web.
  4. Now, try to add another dependency.

Result -> not able to add more dependencies. Also, not able to remove the selected dependency. Name of the selected dependency is also not viewable.

screen shot 2018-08-21 at 4 30 25 pm

Extra

  • Anything that can be relevant

vertx-unit dependency is missing scope test for fat jar to work out of the box

Version

  • vert.x starter:

Context

I encounter issue when I used starter on vertx website.

When I generated project, and just built the code and try to start it I got error

$ java -jar target/vsite-1.0.0-SNAPSHOT-fat.jar
The command 'run' is not a valid command.
See 'java -jar target/vsite-1.0.0-SNAPSHOT-fat.jar --help'

Do you have a reproducer?

  • Link to github project/gist

Steps to reproduce

  1. Generate project for vertx 3.5.0, lang java, dependency web and mysql
  2. Just run mvn clean package
  3. Then try to start fat jar with $ java -jar target/vsite-1.0.0-SNAPSHOT-fat.jar
  4. Error will appear

The command 'run' is not a valid command.
See 'java -jar target/vsite-1.0.0-SNAPSHOT-fat.jar --help'

Extra

Once I edited the generated pom file and put vertx-unit dependency in scope test, all was fine.

Kind Regards

Add generator tests

  • Build generated project
  • Verify source files are present
  • Verify output jar is present
  • Verify test results files are present

Include Maven wrapper

Currently when maven is generated, only the pom.xml is present. For DX, mvn wrapper should be included.
Reference #17

Project generation request should be saved into a DB

The project generation details can be see as Vert.x project usage statistics worth to be persisted for further analytics.

A project generation request is currently managed as a JSON document (without formal structure). In order to keep this flexibility I propose to use a document-oriented storage (MongoDB, or MariaDB/PostgreSQL with JSON support).

Thoughts?

Provide a `Rxjava` option

Vert.x provide a RxJava version of it's api. The starter should mimic this behavior in order to generate a Rx-ified version.

Remove not used options

For the sake of speed, we remove not supported options in order to release a first version.

Empty dependency-definiton in pom.xml

Version

Context

Generated project contains an empty dependecy-definition:

<dependency>
         <groupId>io.vertx</groupId>
         <artifactId></artifactId>
         <version>${vertx.version}</version>
</dependency>

All other dependencies are fine.

Do you have a reproducer?

See the screenshots of the params I used:

  • Entry on start.vertx.io

bildschirmfoto 2017-11-11 um 22 08 16

Maven wrapper shell script is not executable

The generated zip contains a maven wrapper script however the script is not executable so it cannot be used before the user first change the file attributed:

‘chmod a+x mvnw’

This should be set in the zip itself.

run mvm clean test ,got failure

Version

3.6.0

  • vert.x starter:

Context

I encountered an exception which looks suspicious while ...

run below command:
mvw clean test

[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ wxPower ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.413 s
[INFO] Finished at: 2018-12-04T15:32:14+08:00
[INFO] Final Memory: 24M/257M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project wxPower: There are test failures.
[ERROR]
[ERROR] Please refer to D:\owen\project\fudian\backend\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] java.util.ServiceConfigurationError: org.junit.platform.engine.TestEngine: Provider org.junit.jupiter.engine.JupiterTestEngine could not be instantiated
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] java.util.ServiceConfigurationError: org.junit.platform.engine.TestEngine: Provider org.junit.jupiter.engine.JupiterTestEngine could not be instantiated
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:658)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:244)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1149)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:978)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:854)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at org.apache.maven.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:39)
[ERROR] at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:122)
[ERROR] at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:50)
[ERROR]
[ERROR] -> [Help 1]

Do you have a reproducer?

yes, every time

  • Link to github project/gist

Steps to reproduce

  1. generated starter.zip with vertx 3.6.0
  2. in window, execute the mvm clean test
  3. the test goal is failure, any wrong setting in my configuration? but it shouldn't fail in the first place
  4. ...

Extra

  • Anything that can be relevant

Test basic project files

The generated project contains some configuration files like .editorconfig or .gitignore. Their existence and content should be tested.

Define a project type option

Vert.x can serve many objectives, Standard async, Web, etc. It could be interesting to provide a list of blank apps to generate.

At least:

  • a Web server + api endpoints
  • TCP relay
  • Circuit breaker.
  • etc.

Vert.x projects details should be stored externally.

Currently, when you generate a project, the vert.x project list as dependencies (vertx-web, vertx-mqtt, etc.) are fetched from a static json file hosted int the source code of the vertx-starter project.

This file provides many details such as a description of the vert.x project or a Beta flag.

My proposition is to host this file somewhere on the Internet (in the official web site??) and make it available to vertx-starter.

Advanced section

Currently, the starter is a quite simple form. It would be nice to have an advanced section to finely configure the generation. I open this discussion to track what could be part of this advanced section.

Right now what I have in mind:

  • archive format (zip, tgz)
  • the exhustive list of Vert.x components sorted by sections
  • package name
  • Java version
  • systemd scripts

It's an open discussion so feel free to comment.

Can we add a helper main method to deploy the verticle

Version

Vertx version: 3.5.3

  • vert.x starter:

Context

Can we include a helper main method in the MainVerticle to deploy the verticle and run the server? Something like:

  public static void main(String[] args) {
    final Vertx vertx = Vertx.vertx();
    vertx.deployVerticle(new MainVerticle(), handler -> {
      if (handler.succeeded()) {
        System.out.println("Verticle deployed with deployment id: " + handler.result());
      } else {
        handler.cause().printStackTrace();
      }
    });
  }

Link to howtos website

When the howtos website is ready, add a link under the form like "What to do next? Explore Eclipse Vert.x howtos"

Provide analytics via API

Version

  • vert.x starter: 1.0.0

Context

The projects details are valuable insights for the vert-x community.
In order to exploit them, the details should be accessible via an authenticated API.

Do you have a reproducer?

  • N/A

Steps to reproduce

  • N/A

Extra

  • N/A

Create the package structure correctly

Version

  • vert.x starter: 1.0.0-SNAPSHOT

Context

When you generate a project, the java files have a proper package name <groupId>.<artifactId> but file structure isn't created.

empty module name 'io.vertx::3.5.4' in gradle

Version

  • vert.x starter:

Context

I encountered an exception which looks suspicious while building

Generated with empty module name 'io.vertx::3.5.4'

Could not determine the dependencies of task ':shadowJar'.
> Could not resolve all dependencies for configuration ':runtimeClasspath'.
   > Could not find io.vertx::3.5.4.
     Required by:
         project :

Do you have a reproducer?

  • Link to github project/gist

Steps to reproduce

  1. Download starter
  2. ./gradlew build

Extra

  • Anything that can be relevant

Support application "packs"

Currently, the starter lets you select dependencies for the project. This is fine for most projects, but some scenarios require more setup. As a start, we could have packs for an application with:

  • service proxies and rxified API, or
  • gRPC server

For such cases, we could have a "pack" input (similar to dependencies) which would generate everything needed.

Fat jar not executable due to missing resource on AppendingTransformer

Version

Context

Generated maven project fat jar fails to run.

Executing something like

java -jar project-1.0.0-SNAPSHOT-fat.jar

yields

The command 'run' is not a valid command.

Do you have a reproducer?

  • Create a new project (maven based) and execute it

Extra

This is due to a missing resource for the transformer AppendingTransformer on the generated pom.

Adding <resource>META-INF/services/io.vertx.core.spi.launcher.CommandFactory</resource> to the generated pom, fixes the issue

Possibly related with #44

add intelliJ config instructions to starter's readme

Version

  • vert.x starter:

Context

this will help intelliJ users get the starter app running in intelliJ:

IntelliJ, Run/Debug Configurations
Add New Configuration, type "Application"
Main Class: io.vertx.core.Launcher
Program arguments: run com.example.demo.MainVerticle

Projects generated with start.vertx.io can't be run right away

The generated project cannot be run with gradlew run, it says it's not able to find or load the main method (can't copy-paste the error as it's in spanish, sorry). Trying to run the fat jar fails with the same message.

It's easily fixable with some googling, but well, it shouldn't fail in the first place.

Edit: Windows environment, Gradle 4.9

The starter link is not pointing to the good site

Version

  • vert.x starter:

Context

I encountered an exception which looks suspicious while ...

Do you have a reproducer?

  • Link to github project/gist

Steps to reproduce

  1. ...
  2. ...
  3. ...
  4. ...

Extra

  • Anything that can be relevant

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.