Ted is a software developer from the Netherlands. He likes everything that has to do with Java, Grails & Groovy, Agile & Scrum best practices and web development in general. Ted has posted 6 posts at DZone. You can read more from them at their website. View Full User Profile

Introduction to Codenvy

01.04.2014
| 836 views |
  • submit to reddit

 

What is Codenvy exactly? Well, their website states:

Codenvy is a cloud environment for coding, building, and debugging apps.

Basically, it’s an IDE in the cloud (“IDE as a Service?”) accessible by all the major browsers. It started out as an additional feature to the eXo Platform in early 2009 and gained a lot of traction after the first PaaS (OpenShift) and Git integration was added mid-2011.

Codenvy targets me as a (Java) software developer to run and debug applications in their hosted cloud IDE, while being able to share and collaborate during development and finally publish to a repository – e.g. Git – or a number of deployment platforms – e.g. Amazon, OpenShift or Google App Engine.

I first encountered their booth at JavaOne last September, but they couldn’t demo their product right there on the spot over the wifi, because their on-line demo workspace never finished loading :-) Well I got the t-shirt instead then, but now’s the time to see what Codenvy has in store as a cloud IDE.

Signing up

Signing up took 3 seconds. All you have to do is go to codenvy.com, use the “Sign up” button, choose an email address and a name for your workspace, confirm the email they’ll send you and you’re done.

The “workspace” holds all your projects and is part of the url Codenvy will create for you, like “https://codenvy.com/ide/<workspace>.

Although not very clear during the registration process – which of course nowadays is usually minimalistic as can be – it seems that I’ve signed up for Codenvy’s Free Community Plan, which gives me an unlimited number of public projects. You can even start coding without registration.

After confirming the registration mail, I’m in. Finally I’ll end up in the browser where your (empty) workspace has been opened.

Empty workspace

Empty workspace

A few options a possible for here on, as seen in the figure above:

  • Create a New Project from Scratch – Generate an empty project from predefined project types
  • Import from GitHub – Import projects from your GitHub account
  • Clone a Git Repository – Create a new project from any public Git reposiroty
  • Browse Documentation
  • Invite People – Get team members on board
  • Support – Questions, feedback and troubleshooting

Let’s…

Create a New Project from Scratch

This option allows you to name the new project – e.g. “myproject”, choose a technology and a PaaS. The technology is a defined set of languages of frameworks to develop with.

Available technologies

Available technologies

At the moment the technologies are:

At the time of writing  Java 1.6 is supported.

Available PaaS

Available PaaS

At the moment the available platforms are:

Depending on the choice of technology, or or more PaaS options become available. A single JAR can not be deployed onto any of the platforms, leaving only the option “None” available. A Java Web Application (WAR) can be deployed onto any number of platforms, except Heroku and Manymo. Node.js can only be deployed to OpenShift.

Creating a simple JAR project

After having selected a JAR (and no platform) one can select a project template.

E.g. if webapplication (WAR) would have been selected, Codenvy would present project templates, such as Google App Engine Java project illustrating simple examples that use the Search API, Java Web project with Datasource usage ora demonstration of accessing Amazon S3 buckets using the Java SDK.

The JAR technology has only one project: Simple JAR project. After having finished the wizard, our JAR project has been created in our workspace. We’ll see two views of our project: a project explorer and a package explorer.

Project- and Package Explorer

Project- and Package Explorer

What we can see is that our JAR project has been given a Maven pom.xml with the following content:

view sourceprint?01.<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"02.  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">03.  <modelVersion>4.0.0</modelVersion>04.<groupId>com.codenvy.workspaceyug8g52wjwb5im13</groupId>05.<artifactId>testjarproject</artifactId>06.  <version>1.0-SNAPSHOT</version>07.  <packaging>jar</packaging>08. 09.  <name>sample-lib</name>10. 11.  <properties>12.    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>13.  </properties>14. 15.  <dependencies>16.    <dependency>17.      <groupId>junit</groupId>18.      <artifactId>junit</artifactId>19.      <version>3.8.1</version>20.      <scope>test</scope>21.    </dependency>22.  </dependencies>23.</project>

We have a generated group id com.codenvy.workspaceyug8g52wjwb5im13, our own artifact id and the JUnit dependency, which is a decent choice for many Java developers use it as a testing framework. The source encoding has already been set to UTF-8, which is also a sensible choice.

As a convenience we’ve also been given a hello.SayHello class, so we know we’re actually in a Java project :-)

Say Hello

Say Hello

File & Project Management

So what about the browser-based editor we’re working in? On top we’re seeing a few menu’s, like File, Project, Edit, View, Run, Git, PaaS, Window, Share and Help. I’ll be highlighting a few.

File- and Project menu

File- and Project menu

The File menu allows to creating folders, packages and various kind of filetypes, such as text, XML (1.0 at time of writing) , HTML (4.1) , CSS (2.0), Java classes and JSP’s (2.1). Although I’m in a JAR project, I am still also able to create here e.g. Ruby, PHP or Python files.

A very convenient feature is to upload existing files to the workspace, either separately or in ZIP archives. I’ve tried dropping a file onto the Package Explorer from the file system, but the browser (in this case, Chrome) tries to open it instead :-)

The Project menu allows to create new projects, either by launching the Create Project wizard again, but also allows for importing from GitHub. In order to clone a repository, you’ll have to authorize Codenvy to access github.com to be able to import a project.

After having authorized GitHub, Codeenvy presents me with a list of projects to choose from. After having imported all necessary stuff, it somehow needs to know what kind of project I’m importing.

Selecting a file type after importing a project from GitHub

Selecting a file type after importing a project from GitHub

The project I imported didn’t give Codenvy any clues as to what kind of project it is (which is right since I only had a README.md in it), so it lists a few options to choose from. I chose the Maven multi-module type after which the output window shows:

git@github.com:tvinke/examples.git was successfully cloned.
[INFO] Project type updated.

If you’d have a pom.xml in the root of your project, it would immediately recognize it a s a Maven project.

Apart from going through the Project > Import from GitHub option, you can also go directly to the Git menu, and choose Clone Repository. This allows you to manually enter the remote repository URI, wanted project name and the remote name (e.g. “origin”).

Cloning a repository

Cloning a repository

One you have pulled in a Git project, the Git menu allows all kinds of common operations, such as adding and removing files, committing, pushing, pulling and much more.

Git menu

Git menu

The SSH keys can be found under menu Window > Preferences where you can view the github.com entry, where one can view the details or delete it. Also a new key can be either generated or uploaded here.

Sharing the Project

One of the unique selling points of Codenvy are their collaboration possibilities which come along with any project. You can:

Conclusion

Applications are run in the cloud nowadays, so why not create them there too?  Codenvy brings some interesting features, such as being able to instantly provision workspaces (through factory URLs) and share projects in real-time. It supports common operations with projects, files and version control. With a slew of languages and platforms and as an IDE being always accessible through the internet, it could lower the barrier to actually code anytime and anywhere. In a future post I will try and see whether or not it can actually replace my conventional desktop IDE for Java development.

0
Published at DZone with permission of its author, Ted Vinke.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)