Skip to content
an481n edited this page Dec 12, 2016 · 1 revision

Overview

If you are planning to use open source "ajsc" Maven Archetype, you will need to first set up your working environment. This includes downloading/installing Maven if you do not have it as well as installing Maven and Groovy related plugins into your Eclipse/IDE environment for proper project creation and the proper compilation of your project within Eclipse.

Table of Contents Java

Development of AJSC can be performed using Java version: 1.8.We suggest using this for your development environment to avoid possible "minor" issues related to different java updates. Maven

At this time, the AJSC recommends using Maven 3.2.1 or higher.

You will need to have Maven installed on your computer. If you are unsure whether you have Maven installed, open a Terminal Shell/Command prompt, and type, "mvn -version". If you have it, your screen should look something like this:

MacBook-Pro:~ hwerner$ mvn -version Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T07:57:37-04:00) Maven home: /Users/hwerner/Apache/apache-maven-3.3.3 Java version: 1.7.0_21, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.11.2", arch: "x86_64", family: "mac"

If you don't see this, you will need to download Maven from http://maven.apache.org/download.cgi. Follow their instructions for download and installation of Maven. settings.xml

Once Maven is installed on your computer, you will have a new directory, /.m2. Under this directory, you may or may not have a settings.xml file. If you do have it, you will either need to add information from the given settings.xml file shown below. The file needs to be named, "settings.xml", for maven to recognize it properly. If you don't have it, simply add the settings.xml file to your /.m2 directory.

You should now have Maven properly installed on your machine. Maven Integration within Eclipse

Note: STS (Spring Tool Suite) comes with built-in Maven functionality, so the m2e plugins are not necessary (or are already installed), so check out your particular IDE setup, and verify whether or not you have the ability to create Maven projects. Within an Eclipse setup, this would normally be found by Clicking "File, New Project, Maven Project". If you don't see an option for creating a Maven Project, you will need to download the appropriate Maven plugins. Currently, STS is the recommended IDE by the AJSC team.

Now, that you have Maven setup, you may need to download and install a few plugins to allow Eclipse to work with Maven properly. Within your Eclipse Environment (these instructions should work with most Eclipse IDE's, but it might be a good idea to have one of the more recent versions). For Eclipse itself, Juno and newer are recommended as the Maven Integration plugin itself says it works with Juno and newer. ATT Proxy

First, you will probably need to setup the ATT proxy configuration (or similar proxy, if necessary within your working environment's internet environment) within your IDE to allow access to the internet in order to download the plugins.

If you have ever tried to access the Eclipse Marketplace or Install New Software, and have seen the following error message, it is because you do NOT have the proper proxy configuration: Click on Apply and exit out of settings:

m2e Plugin (Maven 2 Eclipse)

Now that your proxy is set, you can find and install the proper plugin. Within your Eclipse IDE, go to Help, Eclipse Marketplace, and search for "Maven Integration". You will find a few plugins available. The suggested one is "Maven Integration for Eclipse (Juno and newer) 1.4. by Eclipse.org, EPL: [mavenIntegrationm2e_Fotor.jpg]

With this plugin installed, you will now be able to create and/or import a Maven project into your Eclipse IDE.

m2e Dynamic Sources Lookup Plugin (Helpful for Debugging)

Another Maven 2 Eclipse related plugin that can aid in development is the m2e Dynamic Sources Lookup Plugin. This plugin helps to automatically lookup source code for you from your .m2 repository making it easier to debug code and set breakpoints. For more information on proper debugging with the AJSC, please goto Remote Setup.

To find this plugin, once again, go to the "Eclipse Marketplace", and search for "m2e Dynamic Sources Lookup"

PLEASE, NOTE: m2e Dynamic Sources Lookup Plugin has moved location within Eclipse Marketplace. You may NOT be able to download this plugin, currently (as of 3/10/16).

Groovy

The AJSC allows you to code in either Java or Groovy for your coding benefit. In order for Groovy code to compile properly and to better debug and visualize the code, you will need to install a few Groovy plugins to better work within the Eclipse Environment. Groovy Plugins

The AJSC archetypes utilize a groovy-compiler plugin. In order for this to work properly in your IDE and Maven, you will also have to download some Groovy plugins.
You will need to find the proper Groovy Download/Update Software site depending on your IDE. STS Groovy Extensions

STS offers a slightly quicker way to download the Groovy plugins necessary for the IDE. When STS starts up, it should open up the "Spring Dashboard" view. There are 2 tabs at the bottom of the Spring Dashboard, "Dashboard, Extensions."

Eclipse (other)

For other Eclipse based IDE's, go to https://github.com/groovy/groovy-eclipse/wiki and select the correct Groovy Update Site corresponding to your IDE.

Next, within your IDE, go to Help, Install New Software, and Click on Add... to add the proper Groovy Software Site from the previous webpage.

Go to this site within Eclipse from the Works with: URL, and select the following plugins: Extra Groovy compilers, Groovy Eclipse SDK, Groovy-Eclipse, and m2e Configurator for Groovy-Eclipse:

[GroovyCompilerMavenIntegration.jpg]

Now, you're ready to build an app/service with the ajsc-archetype.

Clone this wiki locally