question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix the guides which use `className` when generating the project

See original GitHub issue

Describe the bug When creating a new project with the resteasy-jackson extension, it will create its default classes no matter if I provide a className or not. Also the tests are missing but I assume that this is a result of the extension doing something wrong. Following documentation in the getting started guides right now is not possible if the resteasy-jackson extension is involved in the creation process.

Expected behavior Respect the className definition.

Actual behavior (Part of the reproduce section)

To Reproduce Create a project Note: I added also the Neo4j extension to have something to compare with.

mvn io.quarkus:quarkus-maven-plugin:1.10.3.Final:create \                    
    -DprojectGroupId=com.meistermeier.neo4j \
    -DprojectArtifactId=rest-neo4j-quarkus \
    -DclassName="com.meistermeier.neo4j.MovieResource" \
    -Dextensions="neo4j, resteasy-jackson"

creates

➜  rest-neo4j-quarkus tree
.
β”œβ”€β”€ README.md
β”œβ”€β”€ mvnw
β”œβ”€β”€ mvnw.cmd
β”œβ”€β”€ pom.xml
└── src
    └── main
        β”œβ”€β”€ docker
        β”‚Β Β  β”œβ”€β”€ Dockerfile.fast-jar
        β”‚Β Β  β”œβ”€β”€ Dockerfile.jvm
        β”‚Β Β  └── Dockerfile.native
        β”œβ”€β”€ java
        β”‚Β Β  └── com
        β”‚Β Β      └── meistermeier
        β”‚Β Β          └── neo4j
        β”‚Β Β              └── resteasyjackson
        β”‚Β Β                  β”œβ”€β”€ JacksonResource.java
        β”‚Β Β                  └── MyObjectMapperCustomizer.java
        └── resources
            β”œβ”€β”€ META-INF
            β”‚Β Β  └── resources
            β”‚Β Β      └── index.html
            └── application.properties

11 directories, 11 files

whereas

mvn io.quarkus:quarkus-maven-plugin:1.10.3.Final:create \
    -DprojectGroupId=com.meistermeier.neo4j \
    -DprojectArtifactId=neo4j-quarkus \ 
    -DclassName="com.meistermeier.neo4j.MovieResource" \
    -Dextensions="neo4j"

creates

.
β”œβ”€β”€ README.md
β”œβ”€β”€ mvnw
β”œβ”€β”€ mvnw.cmd
β”œβ”€β”€ pom.xml
└── src
    β”œβ”€β”€ main
    β”‚Β Β  β”œβ”€β”€ docker
    β”‚Β Β  β”‚Β Β  β”œβ”€β”€ Dockerfile.fast-jar
    β”‚Β Β  β”‚Β Β  β”œβ”€β”€ Dockerfile.jvm
    β”‚Β Β  β”‚Β Β  └── Dockerfile.native
    β”‚Β Β  β”œβ”€β”€ java
    β”‚Β Β  β”‚Β Β  └── com
    β”‚Β Β  β”‚Β Β      └── meistermeier
    β”‚Β Β  β”‚Β Β          └── neo4j
    β”‚Β Β  β”‚Β Β              └── MovieResource.java
    β”‚Β Β  └── resources
    β”‚Β Β      β”œβ”€β”€ META-INF
    β”‚Β Β      β”‚Β Β  └── resources
    β”‚Β Β      β”‚Β Β      └── index.html
    β”‚Β Β      └── application.properties
    └── test
        └── java
            └── com
                └── meistermeier
                    └── neo4j
                        β”œβ”€β”€ MovieResourceTest.java
                        └── NativeMovieResourceIT.java

15 directories, 12 files

Adding the extension later with ./mvnw quarkus:add-extension -Dextensions="resteasy-jackson" works fine (maybe obvious but I wanted to mention this)

Environment (please complete the following information):

  • Output of java -version: 11 / 15

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ia3andycommented, Jan 19, 2021
0reactions
ia3andycommented, Jan 4, 2021

I am hesitating between a few solutions:

  1. changing the logic so that when className is used (and spring-web is not selected), we automatically add the resteasy example. It would fix all the guides but would make the behavior inconsistent.
  2. updating all the guides which already provide example code in the extension set to be consistent with the new example code
  3. having a new --examples=resteasy option to specify the examples to use and udpate all the guides which need it…
Read more comments on GitHub >

github_iconTop Results From Across the Web

Class Generation Options for a Project in Altium Designer
Right-click on the project name on the Projects panel then click Project Options from the context menu. Options/Controls. AutomaticallyΒ ...
Read more >
Chaning default class name in Maven archetype:generate
I want to create projects in Maven (started using it on for class, so it will be a lot of small projects) without...
Read more >
Why React uses className over class attribute
Step 1: Create a React application using the following command: npx create-react-app foldername. Step 2: After creating your project folderΒ ...
Read more >
Creating the package and class - IntelliJ IDEA Guide - JetBrains
Use IntelliJ IDEA to create a new package and class. If playback doesn't begin shortly, try restarting your device.
Read more >
Java Guide: How to Fix "Could not find or load main class"
The following tips can be useful to resolve the "Could not find or load main class" error: Using correct class name - The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found