Creating a new Maven Project
In Eclipse Project Explorer
Adjust the pom.xml file
- Provide a description of your project if you have missed to edit the archetype property (In
- Adjust the URL to your documentation webpage
- Adjust the properties
git.organization (the organization of your git project in https://git.acc.gsi.de/ if present)
<!-- Adjust this to point to your main class -->
<!-- Adjust this to point to the Git Organisation name where you want to share the project -->
- Adjust the URL to your continuous integration location for the project
- Adjust the URL to your projects bugtracker
- Add yourself as developer in the
<developers> part (change URL to your persons web page)
- provide the correct roles of all developers since these roles are used to generate documentations
- possible roles are: owner, architect, developer and tester
- Replace dependencies by e.g.
<version>14.0.3</version> <!-- look for newer version -->
<version>14.0.0</version> <!-- look for newer version -->
If your project needs some configuration properties, specify them using How To Configuration
Checklist for new Applications
- Use the Standard GSI Frame to guarantee a common look: GsiFrame
- System Properties are stored on the WebServer: Configuration / Startup Options
- Use diagnostic Logging: How to logging
- Use the language translater to internationalize your Application: Language Selector
Build your project
Right click on project -> run as -> maven build ...
- use goals
"clean package" to just ensure your project can be build and to test it locally
"compile exec:java" to run the newly created application
"clean install" to install your project to your local maven repository and build zip file for rollout (ensure the correct codebase is set!)
"clean deploy" to install your project on the nexus
Rename the main class and controller
Once you feel safe enough with the project setup you should rename the main method and controller to the actual name of the application. Using our archetype
as starting point we want to rename it for example to BeamApp.
You will have to rename or edit the selected files in the screenshot.
- Make sure the project is in a compiling state without errors (see eclipse "Problems" view)
pom.xml and change the last part of
bundle.mainClass from TemplateApp to
- Right click on
TemplateApp.java then choose
Refactor -> Rename... enter
BeamApp.java and confirm the following information dialogs with
Alt+Shift+R if you feel comfortable using it)
TemplateApp.java and change
"Beam App" and APP_STYLESHEET to
- Rename the following files in the same way using the
Refactor -> Rename... function (you can use the shortcut
Ctrl+Shift+R to find the files)
- Done. If everything went well there should be no "Problems" and you can still run the app by clicking on the project name in the "Package Explorer", select
Run As -> Maven build... then Goals: "clean compile exec:java" -> Run
Creating a git project and upload your code
Please make sure to read AppHowToGitInEclipseForBeginners
at least up to and including 2.1.
We will create a project in our personal git organisation which can later be move to one of the bigger organisations like fcc-applications or fcc-commons.
Create the gitea project
and Please follow the screenshots.
2. Enter you project name and information
- Owner: You name
- Chose a repository name that resembles or even is the same as the maven artifact name
- Private repository is only if you want to hide the project, none of your collegues will be able to see the project
- Leave the gitignore, license and especially the "initialize repository" option empty. We already have code that we want to upload and don't want do get any conflict
- Hit "Create Repository"
3. Repository created, copy URL
- Repository created successfully - make sure to copy the marked http repository URL.
4. Initialize the local git repository
Now we have to do some command line work. Open a bash shell and navigate to the source files of your project. (To get the path, in Eclipse: select
Project -> Properties -> Location
might help you)
Enter the following commands from the main project directory (were
# download a default gitignore file that will prevent eclipse project files from being uploaded
# Adjust the complete URL to the previously copied one
git remote add origin https://git.acc.gsi.de/REPLACE_COMPLETE_WITH_THE_URL_YOU_HAVE_COPIED_BEFORE
# Add and commit all these changes with the following command
git commit -am 'Initial commit'
# We will then push the changes using eclipse in the next step
5. Push the repository using eclipse
- Now we switch back to eclipse, select our project in the repository explorer and do a
"-> refresh" or hit
F5 while the project is selected
Team -> Push Branch "master"...
- (highlighted blue in the screenshot below)
- if you only have the options "Apply patch", "Share Project", and "Share Projects", choose "Share Project", select GIT and finish, repeate step 2
- There might be a prompt for your local
keystore password, enter it or cancel the
- Click on
Push in the following dialog pages
You can see an entry in your eclipse "history" view now and if you refresh you gitea project page.
- 23 Sep 2014