Aktualisierungen Juni, 2009 Kommentarverlauf ein-/ausschalten | Tastaturkürzel

  • Andreas Höhmann 11:13 am Monday, 8. June 2009 Permalink |
    Tags: , , , Repository   

    Nexus Pro verwaltet Eclipse-Repositories 

    Mit Hilfe von Nexus-Pro (Version 1.3.2) ist es möglich Eclipse-Plugin-Repositories zu verwalten.

    Damit wird es möglich für ein Entwicklungsteam eine Liste von Plugin-Repositories zentral zu verwalten. Alle Entwickler stellen in ihrem Eclipse Update Manager nur noch dieses eine Repository (Nexus) ein und fertig 🙂

    Vorteile:

    • externer Netzwerktraffic wird reduziert
    • Thema Sicherheit, Entwickler müssen nicht unbedingt ins Internet (Proxy etc.)
    • man sieht zentral welche Plugins, in welchen Versionen verwendet werden

    Kurzes Video hier: http://vimeo.com/4102464

     
  • Andreas Höhmann 20:10 am Sunday, 8. February 2009 Permalink |  

    Eclipse 3.5 M5 

    http://download.eclipse.org/eclipse/downloads/drops/S-3.5M5-200902021535/eclipse-news-M5.html

    Wird ja auch mal Zeit für Blockselektion:

    Eclipse 3.5 M5 Blockselect

     
  • Andreas Höhmann 22:33 am Sunday, 16. November 2008 Permalink |
    Tags: debug, , , , sourcecode   

    Hacking maven-eclipse-plugin with eclipse-ide 

    This article show you how you can fix bugs for maven-plugins (eclipse setup for hacking the code, debugging etc.) with a concrete project: maven-eclipse-plugin. Lets start …

    At the moment one of my private todos is to fix a classpath-bug for mavens eclipse-plugin.

    First of all: this maven-plugin is great! If you have a maven-project and you want edit the source inside the eclipse-ide all you have to do is „mvn eclipse:eclipse“ in the base-dir of the project. The plugin will generate all eclipse-files for you, e.g. „.project“, „.classpath“, the „.settings“-directory etc. And there is much more … e.g. pde-development with maven. Have a look at the plugin-homepage.

    Ok. What’s the problem? I have a pom with more than one resources:

    ...
    <build>
     <resources>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/resources</directory>
        <includes>
         <include>**/*.properties</include>
        </includes>
      </resource>
      <resource>
        <filtering>false</filtering>
        <directory>src/main/resources</directory>
        <excludes>
         <exclude>**/*.properties</exclude>
        </excludes>
      </resource>
    </resources>
    </build>
    ...
    

    The resources directory contains a lot of resources. For all property-files i want activate filtering, meens maven should replace placeholders in the files before the result is copied into the target-directory.

    If i now start „mvn eclipse:eclipse“ the plugin doesnt handle the different directories/includes/excludes correct. The result is a .classpath like this (i removed uninteresting entries).

    <classpath>
     <classpathentry kind="src"
                     path="src/main/resources"
                     including="**/*.properties"
                     excluding="**/*.java"/>
    </classpath>
    

    Wrong buildpath

    The second resource (with disabled filtering and the exlude for *.properties) was not included in the classpath. If the resource-directory contains other „important“ files (e.g. spring-xmls for test or images or whatever) then the eclipse-environment is not complete.

    The problem is now clear 🙂 So lets fix the .classpath-generation-code. The plugin-code is available, maven can be started in debug-mode with „mvnDebug eclipse:eclipse“ but then my first debug-session was not sucessful. I’m searching for the correct place to fix the code but where should i place a breakpoint? Mhhh … no sources for the maven-code … first of all i need a complete debugable maven-environment. To make a long story short … i got it 😀 Here is the todo-list:

    1. Use Eclipse and checkout maven-eclipse-plugin (Its a good idea to use the trunk – http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-eclipse-plugin).
    2. Now install the plugin with „mvn install“. This will install the newest version in the local repository.
    3. Then use „mvn eclipse:eclipse“ to generate all eclipse-files for the maven-eclipse-plugin.
    4. Refresh the maven-eclipse-plugin project in the eclipse-ide. Now you are ready to debug a „mvn eclipse:eclipse“ session. But hold a second! Most of the maven code will not be available in the ide, the debugging is not fun. To handle this you must checkout the maven-code.
    5. Use Eclipse and checkout the maven-sources (http://svn.apache.org/repos/asf/maven/components). There are many branches and tags available. Look into the pom.xml of the maven-eclipse-plugin to find out the right version. The plugin-api dependency is perfect for this:

          <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>2.0.8</version>
          </dependency>
      

      So we have to checkout the 2.0.8 branch (http://svn.apache.org/repos/asf/maven/components/tags/maven-2.0.8).

    6. Now build maven with „mvn install“ and prepare the usage in eclipse with „mvn eclipse:eclipse“.
    7. Create a working-set „maven 2.0.8“ and import all subprojects from the maven-project. With eclipse this is very ease. Use the „Existing Projects into Workspace“ import. Select the base-directory of the maven-project and import all subprojects in the workspace. Important: you must delete the „.project“ file in the maven-project-directory to run the bulk-import successfully!
    8. Now your workspace should look like this:
      Ready to hack maven-eclipse-plugin
    9. Now the last step – call „mvn eclipse:eclipse“ for the maven-eclipse-pluigin project (second time). Then you will have a eclipse-project with project-dependencies to the maven-projects (e.g. maven-plugin-api).

    The „eclipse-test“ project contains the above pom.xml with the two resources.

    To debug the eclipse-plugin i have to

    1. Start „mvnDebug eclipse:eclipse“ in the eclipse-test project
    2. Start a „Remote Java Application“ debug-session (localhost:8000) with additional sources of „maven-eclipse-plugin-trunk“ project

    NOW I’M READY TO FIX THE CODE 😀

     
  • Andreas Höhmann 12:34 am Wednesday, 16. April 2008 Permalink |
    Tags: , , ,   

    Maven + Eclipse + Spring 

    Today i show how you can easily develop a Mavenproject with Spring-Beans
    in your Eclipse-IDE. You have to add a new plugin to your pom’s
    plugins-section:

    
    ...
    
    <build>
      <plugins>
        <plugin>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
              <projectNameTemplate>[artifactId]</projectNameTemplate>
              <downloadSources>true</downloadSources>
              <downloadJavadocs>true</downloadJavadocs>
              <wtpmanifest>true</wtpmanifest>
              <wtpapplicationxml>true</wtpapplicationxml>
              <wtpversion>2.0</wtpversion>
              <manifest>${basedir}/src/main/resources/META-INF/MANIFEST.MF</manifest>
              <additionalProjectnatures>
                <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
              </additionalProjectnatures>
              <additionalBuildcommands>
                <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
              </additionalBuildcommands>
              <additionalConfig>
                <file>
                  <name>.springBeans</name>
                  <content>
                    <!&#91;CDATA&#91;<?xml version="1.0" encoding="UTF-8"?>
    <beansProjectDescription>
      <configExtensions>
        <configExtension>xml</configExtension>
      </configExtensions>
      <configs>
        <config>src/main/resource/services.xml</config>
        <config>src/main/resource/datasource.xml</config>
      </configs>
      <configSets>
        <configSet>
          <name>core</name>
          <allowBeanDefinitionOverriding>true</allowBeanDefinitionOverriding>
          <incomplete>false</incomplete>
          <configs>
           <config>src/main/resource/services.xml</config>
           <config>src/main/resource/datasource.xml</config>
          </configs>
        </configSet>
      </configSets>
    </beansProjectDescription>&#93;&#93;>
                  </content>
                </file>
                <file>
                  <name>.settings/org.springframework.ide.eclipse.core.prefs</name>
                  <content>
                    <!&#91;CDATA&#91;<?xml version="1.0" encoding="UTF-8"?>
    eclipse.preferences.version=1
    org.springframework.ide.eclipse.core.builders.enable.aopreferencemodelbuilder=true
    org.springframework.ide.eclipse.core.enable.project.preferences=true
    org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.beans.core.beansvalidator=true
    org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanAlias-org.springframework.ide.eclipse.beans.core.beansvalidator=true
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanClass-org.springframework.ide.eclipse.beans.core.beansvalidator=true
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanConstructorArgument-org.springframework.ide.eclipse.beans.core.beansvalidator=true
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanDefinition-org.springframework.ide.eclipse.beans.core.beansvalidator=true
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanDefinitionHolder-org.springframework.ide.eclipse.beans.core.beansvalidator=true
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanFactory-org.springframework.ide.eclipse.beans.core.beansvalidator=true
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanInitDestroyMethod-org.springframework.ide.eclipse.beans.core.beansvalidator=true
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanProperty-org.springframework.ide.eclipse.beans.core.beansvalidator=true
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanReference-org.springframework.ide.eclipse.beans.core.beansvalidator=true
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.methodOverride-org.springframework.ide.eclipse.beans.core.beansvalidator=true
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.parsingProblems-org.springframework.ide.eclipse.beans.core.beansvalidator=true
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.requiredProperty-org.springframework.ide.eclipse.beans.core.beansvalidator=true
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.action-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.actionstate-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.attribute-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.attributemapper-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.beanaction-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.evaluationaction-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.evaluationresult-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.exceptionhandler-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.import-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.inputattribute-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.mapping-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.outputattribute-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.set-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.state-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.subflowstate-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.transition-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.variable-org.springframework.ide.eclipse.webflow.core.validator=false
    org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.webflowstate-org.springframework.ide.eclipse.webflow.core.validator=false
    &#93;&#93;>
                  </content>
                </file>
              </additionalConfig>
            </configuration>
          </plugin>
        </plugins>
      </build>
    ...
    

    Then you can run mvn eclipse:clean eclipse:eclipse (eclipse:clean is not required). The eclipse-plugin will create/change the .springBean and the .settings/org.springframework.ide.eclipse.core.prefs. Then you can refresh the eclipse-project (F5) from now the project contains a Spring-Builder which will handle the defined spring-configuration-files services.xml and datasource.xml. If you have more Springfiles you have to change the plugin-configuration.

     
c
Neuen Beitrag erstellen
j
nächster Beitrag/nächster Kommentar
k
vorheriger Beitrag/vorheriger Kommentar
r
Antworten
e
Bearbeiten
o
zeige/verstecke Kommentare
t
Zum Anfang gehen
l
zum Login
h
Zeige/Verberge Hilfe
Shift + ESC
Abbrechen