We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I followed this (http://guides.micronaut.io/creating-your-first-micronaut-app/guide/index.html) guide but instead of generate a Gradle project I created a new project with maven dependencies.
In that way I only have two classes: Application.java and HelloController.java. My purpose was to simply run Application.java in Intellij's IDE.
What I expected was the creation of a random port localhost which I would be able to invoke with, for example, postman's application.
What really happens is that when I run the class the following message appears:
"io.micronaut.runtime.Micronaut start INFO: No embedded container found. Running as CLI application".
HelloController.java
package example.micronaut; import io.micronaut.http.MediaType; import io.micronaut.http.annotation.Controller; import io.micronaut.http.annotation.Get; import io.micronaut.http.annotation.Produces; @Controller("/hello") public class HelloController { @Get("/") @Produces(MediaType.TEXT_PLAIN) public String index() { return "Hello World"; } }
Application.java
package example.micronaut; import io.micronaut.runtime.Micronaut; public class Application { public static void main(String[] args) { Micronaut.run(Application.class); } }
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven- 4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.microservice</groupId> <artifactId>example-micronaut</artifactId> <version>1.0-SNAPSHOT</version> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>example.micronaut.Application</mainClass> </manifest> </archive> </configuration> </plugin> </plugins> </build> <dependencies> <!-- JAVA 9+ and LOG dependencies --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-jdk14</artifactId> <version>1.7.25</version> </dependency> <dependency> <groupId>javax.annotation</groupId> <artifactId>javax.annotation-api</artifactId> <version>1.3.2</version> </dependency> <!-- Project dependencies --> <dependency> <groupId>io.micronaut</groupId> <artifactId>runtime</artifactId> <version>1.0.0.M4</version> </dependency> <dependency> <groupId>io.micronaut</groupId> <artifactId>http-client</artifactId> <version>1.0.0.M4</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> </dependencies> </project>
The text was updated successfully, but these errors were encountered:
@mOo7King On a Windows 10 machine, I took the following steps using Micronaut 1.0.0.M4 (git bash shell):
mn create-app test --build maven cd test ./mvnw compile ./mvnw exec:exec
mn create-app test --build maven
cd test
./mvnw compile
./mvnw exec:exec
The application started successfully.
The pom.xml file you have there will definitely not work as there is more configuration that is required.
Sorry, something went wrong.
@jameskleeh Thanks for helping. It worked for me.
No branches or pull requests
I followed this (http://guides.micronaut.io/creating-your-first-micronaut-app/guide/index.html) guide but instead of generate a Gradle project I created a new project with maven dependencies.
In that way I only have two classes: Application.java and HelloController.java.
My purpose was to simply run Application.java in Intellij's IDE.
Expected Behaviour
What I expected was the creation of a random port localhost which I would be able to invoke with, for example, postman's application.
Actual Behaviour
What really happens is that when I run the class the following message appears:
"io.micronaut.runtime.Micronaut start
INFO: No embedded container found. Running as CLI application".
Environment Information
Code
HelloController.java
Application.java
pom.xml
The text was updated successfully, but these errors were encountered: