Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-4814

eclipse maven integration

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.8
    • Fix Version/s: 1.13.0
    • Component/s: Build / Packaging
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None

      Description

      There are a couple of additions that can be added to a pom.xml which eclipse m2e will use to help setup the project inside eclipse.

      The first one here adds a target/generated-sources/castor to the build path so eclipse will find the generated classes when it builds the project. This change is nice because then you don't have to manually select the castor directory and right click -> build path -> use as source directory.

      <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>build-helper-maven-plugin</artifactId>
      <executions>
      <execution>
      <id>add-castor-generated-sources</id>
      <phase>process-sources</phase>
      <goals>
      <goal>add-source</goal>
      </goals>
      <configuration>
      <sources>
      <source>${project.build.directory}/generated-sources/castor</source>
      </sources>
      </configuration>
      </execution>
      </executions>
      </plugin>

      The second change is to mark a goal as execute in an eclipse build. For some plugins eclipse doesn't know what to do with them, so it suggests a quick fix where it will modify the pom.xml and ignore that goal. It will add a pluginManagement..plugin and we just change the action from ignore to execute.

      <pluginManagement>
      <plugins>
      <!-This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.->
      <plugin>
      <groupId>org.eclipse.m2e</groupId>
      <artifactId>lifecycle-mapping</artifactId>
      <version>1.0.0</version>
      <configuration>
      <lifecycleMappingMetadata>
      <pluginExecutions>
      <pluginExecution>
      <pluginExecutionFilter>
      <groupId>
      org.codehaus.mojo
      </groupId>
      <artifactId>
      axistools-maven-plugin
      </artifactId>
      <versionRange>
      [1.4,)
      </versionRange>
      <goals>
      <goal>wsdl2java</goal>
      </goals>
      </pluginExecutionFilter>
      <action>
      <ignore></ignore>
      </action>
      </pluginExecution>
      </pluginExecutions>
      </lifecycleMappingMetadata>
      </configuration>
      </plugin>
      </plugins>
      </pluginManagement>

      The attached patch will make it so eclipse doesn't fail when building opennms. The only remaining thing to fix so eclipse can build all of opennms is to update maven-resources-plugin to 2.4 or later so its supported by m2e.

      Ron

        Attachments

          Activity

            People

            • Assignee:
              seth Seth Leger
              Reporter:
              ronald.roskens@biworldwide.com Ron Roskens
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: