Annotation based build extension implementation for ballerina.
- Generate text file with the greetings
Annotation Name | Description | Default value |
---|---|---|
salutation | Greeting or Acknowledgement | Hello! |
- Download and install JDK 8 or later
- Get a clone or download the source from this repository (https://github.com/ballerinax/hello)
- Run the Maven command
mvn clean install
from within the hello directory. - Copy
target/hello-extension-0.970.0.jar
file to<BALLERINA_HOME>/bre/lib
directory. - Run
ballerina build <bal filename>
to generate artifacts.
The hello world artifacts will be created in a folder called target with following structure.
target/
├── outputfilename.txt
└── outputfilename.balx
import ballerina/http;
import ballerinax/hello;
@hello:Greeting{salutation : "Guten Tag!"}
@http:ServiceConfig {
basePath:"/helloWorld"
}
service<http:Service> helloWorld bind {port:9091}{
sayHello (endpoint outboundEP, http:Request request) {
http:Response response = new;
response.setStringPayload("Hello, World from service helloWorld ! \n");
_ = outboundEP -> respond(response);
}
}