Technical Blog Of JackCHAN

August 23, 2010

The PHP development environment in Eclipse

Filed under: eclipse, php, Technology — Tags: , , — kaisechen @ 2:00 am

The PDT project provides a PHP Development Tools framework for the Eclipse platform.This project encompasses all development components necessary to develop PHP and facilitate extensibility. It leverages the existing Web Tools Platform (WTP) and Dynamic Languages Toolkit (DLTK) in providing developers with PHP capabilities.

1. Firstly download eclipse classic version

http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.6-201006080911/eclipse-SDK-3.6-win32.zip

June 4, 2010

Configue svn plugin in Eclipse/MyEclipse (3)

Filed under: eclipse, java, linux, myeclipse, svn, Technology — Tags: , , , , — kaisechen @ 5:44 am

Next, we need to set the ‘Enviroment variables’  ‘SVN_SSH’ in your desk machine.

1) Right click ‘mycomputer’, choice ‘Properties’, in ‘System Properties’, choice ‘Advanced’, click ‘Enviroment variables’.

2) in ‘System variables’, input ‘SVN_SSH’ value, then click ‘ok’

Now, we can begin to use svn plugin in eclipse/myeclipse

You can check in a new project into svn server or check out a existed project from svn server.

If check in a new project into svn server.

1) Chose the project, right click, and in popuped list, chose ‘Team’, then chose ‘Share Project….”

2) chose ‘SVN’

3)create a new repository location

4)Input the url:svn+ssh://jackchan@mycompany.com/svn/myproject/trunk/

5)Enter fold name

6)click Finish

If check out a existed project from svn server.

click File–>’Import…’ , chose ‘SVN’ , ‘checkout projects from SVN’, create a new repository location or use existing repository location, click ‘next’, select the folder to be checked out from SVN, then click ‘Finish’ button.

Because we have finished the ssh automation connection configure, the process of check out or check in will be finished automatically.

If the configue is fine, we should see svn plugin work normally.

Configue svn plugin in Eclipse/MyEclipse (1)

Filed under: eclipse, java, linux, myeclipse, svn, Technology — Tags: , , , , , — kaisechen @ 2:25 am

How to connect svn Server?

I tried sliksvn, tortoisesvn.

Sliksvn don’t support too much protocal, such as svn+ssh.

Tortoisesvn is good as a svn client.

Both of them support command line. But my favorite IDE is eclipse/myeclipse, so i decide to install a svn client plugin.

There are two kind svn plugins .

(1) Eclipse Subversive – SVN Team Provider Project, Visit http://www.eclipse.org/subversive

(2)Subversion Native Library Adapter (JavaHL), Subclipse is an Eclipse team provider for the Subversion version
control system.  Visit http://subclipse.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/), includes SVNKit(http://svnkit.com/).

I installed both of them,Eclipse Subversive installs and uses easily, so i  just introduce how to install subversion.

Install subversion steps:

1) In myeclipse, click help–>Software Update –>Add/Remove Software …

2)click “Add”. Then in the opened window, click “Add Site..”.

input ‘http://subclipse.tigris.org/update_1.6.x’

3) click “OK”, click “next”, click “Apply”, the myeclipse will begin to install the plugin, and after finishing the install, it will remind to restart myeclipse.

June 2, 2010

Using Maven In Eclipse/Myeclipse

Filed under: eclipse, hibernate, java, myeclipse, Spring, Technology — Tags: , , , , , , , — kaisechen @ 5:18 am

How to use maven to manage a web application in eclipse/myeclipse?

Firstly,we  need to install one kind of  maven plugin in eclipse/myeclipse.

There are three options which provide Maven integration for Eclipse/MyEclipse.

1)m2eclipse

http://m2eclipse.sonatype.org/, it is the most matured maven plugin for eclipse at the moment

2)Eclipse IAM

3)Maven4MyEclipse, which is base on myeclipse

Maven4MyEclipse and Maven-enabled MyEclipse projects co-exists with command line Maven use perfectly,Maven4MyEclipse was designed, however, to make command line Maven un-necessary in most instances, allowing you to stay inside the IDE and execute all Maven tasks from the UI.

The vice of maven4myeclipse is :

Maven4MyEclipse brings Maven support to MyEclipse Web Projects, MyEclipse EJB Projects, and conventional Java projects,MyEclipse Enterprise Application (EAR) Projects are not supported at this time, but should be in a future release.

Because i am using myclipse, i decided to use Maven4MyEclipse plugin,it is very easy to install it, let’s jump the step.

Secondly, we create a web project ‘Add Maven Support’ in myclipse.’

Thirdly, find the ‘pom.xml’ under the project, open it with ‘Maven POM Editor”

A POM(Project Object Model) is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details used by Maven to build the project. It contains default values for most projects. Examples for this is the build directory, which is target; the source directory, which is src/main/java; the test source directory, which is src/main/test; and so on.

There are a lot of configues including Overview,Dependencies,Repositories,Build and so on.

Fourthly, we need install maven  and configue a local repository.

Download the maven from http://maven.apache.org, unzip it to any disk directory(e.g. D:\apache-maven-2.2.1). Modify settings file under conf(D:\apache-maven-2.2.1\conf).

Add one line:

<localRepository>D:/apache-maven-2.2.1/.m2/repo</localRepository>

Fifthly, configue maven4myeclipse in myclipse.

Open MyEclipse –>Preferences –>Maven4Myeclipse–>Maven–>Installations,

In User Settings,load the settings.xml in fouth step.

Sixthly,configue ‘Dependencies’ and ‘Repositories’  using ‘Maven Pom Editor’.

Add jboss repository if can’t find library in default maven repositories.

ID:org.jboss.repository.maven, URL:http://repository.jboss.org/maven2

After adding ‘dependencies’, the tool can produce a dependency graph.

In my project, i use spring mvc,hibernate etc. So the dependency graph looks like:

Seventhly, Deploy the web application into Tomcat/Jboss container.

Right click the web application, in popuped list, chose ‘Debug As’,chose ‘MyEclipse Server Application’, chose Tomcat or Jboss.

It is hot deployment, it is convenient to debug application.

Blog at WordPress.com.