Tag Archives: eclipse

svn and eclipse… and maven

ok one of the problems of eclipse with svn is that no eclipse specific file should be commited to the repository… mainly because they are developers computer specific and kinda crap on others computers… additionally not every one uses eclipse… so that the hell should he be doing with the eclipse files? so goal is to delete and ignore them… simple… but now every body needs to set his project localy correctly…

with maven it is actually a bit more confusing… which folders to add? how to add the Maven Dependencies?

Right Click the Project -> Maven -> Update Project Configuration

Done 🙂

maven create eclipse

Just enter following command:

mvn archetype:create -DgroupId=com.test -DartifactId=mytest

The project will be created… to add it to eclipse it is important to run this command:

mvn eclipse:eclipse

now it can be imported to eclipse

m2e

m2e is a really cool plugin for eclipse to run maven commands… i think it is mandatory for developing maven project with eclipse… and normally the installation is easy… but due to missing requirements i got really pissed and have still didnt figured it out…

but today is a good day… http://dev.eclipse.org/mhonarc/lists/m2e-users/msg01880.html

apache cxf, tomcat and eclipse

apache cxf is my next stop… its a simple way to create webservices… and the tutorial is really hard… ok perhaps only for a for-a-long-time-no-java-developing developer, as i am… the main problem was, that the tutorial is based on your favorite ide… which in my case is eclipse, but without a little bit of help, my favorite ide is really confusing… but with a little help of other (unlinked) tutorials, a little bit of basic understanding of the (and some) concepts and a little bit luck i made it 🙂 ok not sure, but i see an autogenerated wsdl, which actually locks correct 🙂

so what did i do… setting up:

  1. downloaded apach cxf and added it to PATH (not sure if needed)
  2. in eclipse Windows–>Preferences–>Web Services–> CXF 2.x Preferences set the downloaded cxf folder
  3. intsalled a tomcat… its a lie, because it was installed before, but wth
  4. in eclipse Windows–>Preferences–>Server–>Runtime Environment added the tomact… lie again, was set already…

and now… project:

  1. New–>Dynamic Web Project (Name = CXFTest)
  2. Configured it with Target Runtime = Apache Tomcat and Configuration = CXF
  3. Then created all the files, based on the tutorial
  4. To Run: Right – clicked the web.xml and Run As–> Run on Server
  5. Access the WSDL: http://localhost:8080/CXFTest/HelloWorld?WSDL
  6. tada!

i acutally had really big problems to find the wsdl at first, but now its kinda logic 🙂

eclipse import cleanup

import other classes to a class is mainly a pain… a lot of imports are normally needed, a few are duplicated, and this is crap… based on PMD… ok it might be right, but in my point of view the compiler should clean the import… not that i have ever thought about it, but currently i do… 😛

and eclipse can clean the imports easyly….

Crtl+Shift+o

bah…

Eclipse is running in a JRE, but a JDK is required

this bug sucks… and its funny, because i get it from time to time… solution is kinda easy…

add following link in eclipse.ini

-vm
C:\java\jdk\bin\javaw.exe

before

-vmargs

import maven projects to eclipse

maven has its predefined structure of the project files and there is a simple, easy command to create it 🙂

mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app

and yeah… its from a tutorial… so the structure is ready… the pom.xml is created… but it has no eclipse .project file… ok i could have created the same thing in eclipse, with a maven plugin, which is actually installed on my eclipse… but as i told you before… its a tutorial… and importing to eclipse is easy… with the plugin…

Import… –> Maven –> Existing Maven Project

nuff said…

building in maven

once again… new projects, new concepts and new technologies… this time its maven… the project i am working on, has already set up everything (hopefully)… and my maven knowledge didnt even allow starting the build process… so current reading everything about maven… starting with the wiki page… an building is named packaging… and the console command is:

mvn package

or in eclipse:

right-clicking the project –> Run as –> Mavan Package