博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Create a Roo project from Spring ToolSuite
阅读量:5922 次
发布时间:2019-06-19

本文共 5101 字,大约阅读时间需要 17 分钟。

  hot3.png

#Create a project from Spring ToolSuite#

The Spring company, provides a full stack solution for Spring development, including excellent IDE support, SpringSource provides an Eclipse based IDE to speed up the development of Spring project.

##Install Spring ToolSuite

You can download a copy of Spring ToolSuite from , and install it into your local disk.

Alternatively, you can get a copy of the JEE bundle from Eclipse website and install Spring ToolSuite plugin manually.

  1. Download the newest Eclipse JEE Bundle from the .
  2. Extract the files from the zip archive into your local disk.
  3. Start up Eclipse IDE.
  4. Open Eclpse Marketplace from Help menu in the IDE menu bar.
  5. Search SpringSource to find the Spring ToolSuite plugin.
  6. Click Install button and wait the installation done.
  7. Restart IDE according to the prompt, and apply the change.

Note: In the further content, I will use the words IDE or Eclipse, it refers to Spring ToolSuite or Eclipse IDE with Spring ToolSuite plugin installed.

Some Maven plugin such as APT needs a JDK instead of JRE at runtime.

Open Preference dialog, type JRE in the query text box to find the JRE you are using, change the JRE location to your JDK's location.

Also do not forget adjust the STS.ini, add -vm parameter, place it above the -vmargs. An example here.

<pre> -vm D:/jdk7/bin/javaw.exe ... -vmargs ... </pre>

Optionally, install the m2e wtp plugin from Eclipse Marketplace to improve the web application support in Eclipse IDE.

  1. Open the Eclipse Marketplace from Help menu of the Eclipse main menu.
  2. Type wtp to search the Eclipse WTP related plugins.
  3. Select Maven Integration for Eclipse WTP(incubation) and click Install button.
  4. Wait for the installation done, follow the Eclipse prompt and restart Eclipse to apply the plugins.

##Create a Roo based project

Spring Roo is supported in Spring ToolSuite. You can create a Roo based Spring project from Eclipse directly.

  1. Open the Spring Roo Project creation wizard.

You can open the Roo project wizard from the SpringSource Dashboard(the "Home" page of Spring ToolSuite),

Open Roo project from SpringSource Dashboard

or follow the New project wizard. It is fairly easy work.

Create Roo project from new project wizard

  1. Fill the basic project info in the new Roo project dialog.

Create Roo project from new project wizard

  1. Click Finish button to complete the creation.

After you created such one project, Eclipse should open a Roo shell view for you.

Create Roo project from new project wizard

Yes, Spring ToolSuite integrate a command line interface in IDE directly, you can use it freely, just like the one in your system terminal.

##Setup essential artifacts

You can type the addon command the Roo Shell view and use IDE code assistance shortcuts( CTRL+SPACE by default) to get the available options.

Create Roo project from new project wizard

Now you can follow the steps in and try to create a new Entity Conference in the Eclipse based Roo console.

Open the entity class Conference you have just created in the Roo console, try to add a new property name, and save it. Eclipse will synchronize the change set to the Roo related aspect files, you can some logging info in the Roo console.

Open Conference_Roo_JavaBean.aj in the same package, you will find the getter and setter of the name property are generated.

<pre> privileged aspect Conference_Roo_JavaBean { public String Conference.getName() { return this.name; } public void Conference.setName(String name) { this.name = name; } } </pre>

It is magic.

Follow the steps in last post and add other artifacts yourself.

##Run the project

A developer edition of VMware vFabric Server is shipped with Spring ToolSuite.

Run project in is really simple, just drag the project root node to the server instance and release it.

The project will be deployed into the server.

Create a cloudfoudry server instance

Open browser, go to <appName>.

Create a cloudfoudry server instance

##Deploy into CloudFoundry

Firstly make sure you have installed CloudFoundry Eclipse plugin.

If not, you can switch to the Extension tab in the SpringSource Dashboard interface. And find CloudFoundry in the list, click the checkbox before the CloudFoundry item and hint Install button to install it into your IDE.

  1. Create a CloudFoundry server instance.

In the Server view, right click the whitespace and hint the New item in the context menu, and open the New server wizard.

Create a cloudfoudry server instance

Expand VMware node and select CloudFoundry and press Next button.

Create a cloudfoudry server instance

Enter your account info of CloudFoundry.com, click Validate Account to check if the email and password is valid.

Click Finish button, you will see a CloudFoundry instance in the Server view.

  1. Right click the CloudFoundry node in the Server view, select Add and remvoe... in the context menu.

  2. In the popup dialog, select the created project and press Add button.

Create a cloudfoudry server instance

  1. Fill the application details.

Fill the application details

  1. Fill the launch deployment info.

Fill the launch deployment info

  1. In the next step, you can select the service you want to be bound to this application. You can also create a new service by click the New icon here.

Service selection

  1. Click Finish button to complete the steps.

You will see a new application node under the CloudFoundry server instance.

Service selection

If it is stopped, try to start it by clicking the Start in the context menu. You can also perform a Full publish to deploy a fresh application into CloudFoundry.

Navigate to the application home page.

RUN

转载于:https://my.oschina.net/hantsy/blog/132470

你可能感兴趣的文章
oo第三单元总结
查看>>
day31 configparser 配置文件模块
查看>>
线程池之每隔一段时间调用一个函数
查看>>
[NHibernate]组件之依赖对象
查看>>
转://Oracle数据库升级后保障SQL性能退化浅谈
查看>>
.net跨平台解决方案------mono真正实现C#代码一次编写处处运行
查看>>
HttpWebRequest 向网站提交数据 (post与get方式)
查看>>
2017-2018-1 20155312 《信息安全系统设计基础》第八周学习总结
查看>>
JVM
查看>>
概括的解释下线程的几种可用状态。
查看>>
LeetCode 55. Jump Game I / II
查看>>
Java练习 SDUT-2445_小学数学
查看>>
bzoj 3126: [Usaco2013 Open]Photo——单调队列优化dp
查看>>
HashMap的实现原理
查看>>
字符串str.format()方法的个人整理
查看>>
Scrapy源码注解--CookiesMiddleware
查看>>
make命令--基础
查看>>
开通首页笔记
查看>>
配置管理
查看>>
django-路由层
查看>>