This article is translated from the cloud foundry english blog site, entitled "cloud foundry integration for eclipse now supports standalone Java applications
And java 7 ", the article was published on July 7, September 13, 2012.
The new version of cloud foundry integration for eclipse is now available. This version can be used to publish independent Java applications to cloudfoundry.com using Java 6 or Java 7. Currently, Java 7 is also supported for grails, Java Web, and spring applications. Independent applications can only be published to cloud foundry instances that support independent applications, such as cloudfoundry.com.
With the new integration (version 1.2.0), you can release independent Java applications from eclipse indigo Jee or springsource Tool Kit (STS) version 2.9.0 or later.
The previous cloud foundry plug-in (1.1.0) introduced tunneling support for data services. Version 1.2.0 also includes further improvements to service tunnels.
Follow the instructions in the document to install cloud foundry integration for eclipse. If you have installed the cloud foundry plug-in 1.0.0 or 1.1.0 in eclipse or STS, this update is automatically detected. You can also manually check for updates in IDE. Note that the old version of cloud foundry plug-in earlier than 1.0.0 is not supported. Must be uninstalled first
The earlier version of the plug-in before 1.0.0 can be installed with 1.2.0.
Enable standalone support
Now, by enabling cloud foundry's independent support for Java projects, you can publish Java projects in eclipse to cloudfoundry.com, and then treat other supported application types (grails, spring) Like) drag it to the cloud foundry server instance in the servers (server) view or the applications (applications) section of the server editor.
To publish a Java project to cloudfoundry.com, you only need to select the project from the project or package explorer, right-click and select
Configure-> enable standalone application as cloud Foundry (enable as cloud foundry standalone APP).
To delete this configuration, you can selectConfigure-> disable standalone applications as cloud Foundry (disable as cloud foundry standalone APP).
Java independent applications can be released in just a few simple steps:
1. Right-click the Java project and enable standalone.
2. Drag the application to the servers (server) view or server editor of The cloudfoundry.com server.
3. Complete the open Application Wizard, which is very similar to releasing any other supported applications.
Configure independent Java applications
Drag an independent Java application to the cloudfoundry.com server instance in the servers (server) view or the editor of the server, and then open the Application Wizard, you can configure application details such as application name and runtime type in this wizard.
Java 6 and Java 7 are supported for independent applications at the same time. You can select from the "RunTime" widget shown above.
In many cases, the main method is used to automatically detect Java types and deploy applications on the first page of the wizard. If the main method type is not detected or you want to change the automatic parsing Type, click "Next" and set the Java startup command on the displayed page.
Unlike other supported applications such as grails or spring, the URL of an independent Java application is optional. However, the startup command is required.
You can choose one of the following two methods to specify the startup command:
1. Java: a JVM Java startup command. Set the Recommended default option to "$ java_opts-CP lib/*:." and set the Java type with the main method. The LIB folder of the class path option does not need to exist in the Java project. This folder is automatically created remotely on the cloud foundry server. All jar project dependencies (except JRE dependencies) are published in this folder.
2. Other (Others): A complete user-defined startup command, which can include the name of the script file.
For the first option, you can use the built-in Java content to help select the Java type in the main type text widget.
Alternatively, you can click the Browse button to open the Java browser dialog box.
If you select "other" (other), you can specify the complete startup Command, as shown in the script file.
After the release, you can manage independent applications in the cloud foundry server editor just like other application types, this includes starting, stopping, restarting, updating, and restarting applications, deleting applications, and changing the number of application instances and memory settings. You can also click remote systems view in the server editor to view published resources.
Java application dependencies
All independent dependencies (except JRE dependencies) are automatically parsed and published to the remote "lib" folder on the cloud foundry server relative to the application folder. Before release, the Lib Folder does not need to exist in Java applications.
For example, for Java Maven projects, all Maven dependencies are published to the remote lib directory relative to the application.
Cloud foundry independently supports releasing application resources to ECs Based on the configurations defined in the project's Java build path (Java build path. Any resources required by the application (including the Java source output or target folder, binary files, and XML and script files) must be listed in the Java build path (Java build path) of the project. You can right-click the Java project and select
"Build path"-> "Configure build path ..." (Configure build path ...)To access the Java build path ).
In addition, the independent support will automatically skip the test source folder, even if they are listed in the project's Java build path (Java build path. The output target of the source folder containing the "src/test" mode will also be skipped.
Java 7 Support for other application types
In addition to supporting Java 7 for independent applications, cloud foundry integration for eclipse and STS now support releasing grails, spring, Java Web, and lift to cloudfoundry.com using Java 7. For other ECs instances, the default runtime type is still Java 6. Java 7 is displayed only when the server supports it.
You can install or update cloud foundry integration for eclipse 1.2.0 from the following official Update site:
Http://dist.springsource.com/release/TOOLS/cloudfoundry/
-Cloud foundry team