Setting up the development environment
Just navigate into a directory of your convenience and checkout the code from this repository using the command:
git clone https://github.com/mariomgal/eurosentiment-tutorial-java.git
The project is built using Apache Maven. You can use any editor of your choice for coding, here some steps are given for the most usuals ones (Eclipse and IntelliJ Idea).
- Open a shell window and navigate to the directory where you just checked out the project code.
- Execute the maven command
mvn clean eclipse:eclipse
. - Open Eclipse and navigate to the menu File -> New -> Java Project.
- Uncheck the "Use default location" option and select the location of the code.
- Click "Finish". You should be ready to start coding.
- Just open IntelliJ Idea, navigate to File -> Import project and select the pom.xml file in the projects' folder. That's all.
The project comes with a simple default sentiment service already implemented and deployable as web service. Just run the class samples/Application.java
inside your IDE. It will start an emmbedded web server in http://localhost:8090/sentiment
to which you can send POST
requests and examine the results.
This approach is useful for doing specific tasks at the development stage, such as code debugging.
You can also run the project inside a command shell with Maven. Just go to the project folder and run the command mvn spring-boot:run
.
Eventually, you can face some errors while running the embedded web container. When this happens, it's usually useful perform clean operations, via command shell (mvn clean
) or in the IDE (Project -> Clean, in Eclipse).
EUROSENTIMENT PROJECT (Grant Agreement no: 296277, Starting date: 01/09/2012, Project duration: 24 months)