Maven Eclipse Plugin
  1. Maven Eclipse Plugin
  2. MECLIPSE-270

Add support for classpathentry attributes

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.6
    • Component/s: AJDT support
    • Labels:
      None
    • Number of attachments :
      0

      Description

      With eclipse 3.3 and AJDT 1.5 aspect jars are now configured as an attribute nested inside of the .classpath file's <classpathentry> element Like so:

      <classpathentry kind="var" path="M2_REPO/org/springframework/spring-aspects/2.0.5/spring-aspects-2.0.5.jar" sourcepath="M2_REPO/org/springframework/spring-aspects/2.0.5/spring-aspects-2.0.5-sources.jar">
      <attributes>
      <attribute name="org.eclipse.ajdt.aspectpath" value="true"/>
      </attributes>
      </classpathentry>

      It would be nice if it were possible to add attributes to classpathentry's with some kind of configuration syntax where maybe the dependency artifact and group are specified and then the attributes for that dependency.

      Mike

        Issue Links

          Activity

          Hide
          Michael Schnake added a comment -

          And with eclipse 3.3, AJDT 1.5 and WTP (to correctly export classpath entry as J2EE Module Dependency) it becomes

          <classpathentry kind="var" path="M2_REPO/org/springframework/spring-aspects/2.0.5/spring-aspects-2.0.5.jar">
          <attributes>
          <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
          <attribute name="org.eclipse.ajdt.aspectpath" value="true"/>
          </attributes>
          </classpathentry>

          Mike (another one

          Show
          Michael Schnake added a comment - And with eclipse 3.3, AJDT 1.5 and WTP (to correctly export classpath entry as J2EE Module Dependency) it becomes <classpathentry kind="var" path="M2_REPO/org/springframework/spring-aspects/2.0.5/spring-aspects-2.0.5.jar"> <attributes> <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> <attribute name="org.eclipse.ajdt.aspectpath" value="true"/> </attributes> </classpathentry> Mike (another one
          Hide
          Cris Daniluk added a comment -

          Would something like org.eclipse.ajdt.aspectpath be on for every dependency? I.e. in the existing WTP support, everything is exported in the component file and thus in WTP 2, every single dep would have the org.eclipse.jst.component.dependency attribute... that may not make sense in some projects, but it is compatible with the older WTP support.

          So what I'm asking is... is that good enough? If so, I think maven-eclipse-plugin can handle it fairly easily. If it is not, it may be trickier... As of right now, maven doesn't have a way I know of to parameterize the deps to indicate which do/do not need aspectpath. So, you'd have to have a plugin config for maven-eclipse-plugin that duplicated every single dep to add that config.

          Show
          Cris Daniluk added a comment - Would something like org.eclipse.ajdt.aspectpath be on for every dependency? I.e. in the existing WTP support, everything is exported in the component file and thus in WTP 2, every single dep would have the org.eclipse.jst.component.dependency attribute... that may not make sense in some projects, but it is compatible with the older WTP support. So what I'm asking is... is that good enough? If so, I think maven-eclipse-plugin can handle it fairly easily. If it is not, it may be trickier... As of right now, maven doesn't have a way I know of to parameterize the deps to indicate which do/do not need aspectpath. So, you'd have to have a plugin config for maven-eclipse-plugin that duplicated every single dep to add that config.
          Hide
          Mike Youngstrom added a comment -

          I think that being able to specify an attribute to apply to all dependencies would work in the aspectj case so the addition of that functionality would be great at a minimum.

          Though perhaps in the future I think it would be nice to specify attributes for individual dependencies as well for other plugins in the eclipse plugin configuration xml. I don't know much about how maven plugin development works but such configuration could perhaps look like:

          <configuration>
          <attributes>
          <attribute name="some.attribute.name" value="attributeValue">
          <dependency>
          <groupId>some.group</groupId>
          <artifactId>someArtifact</artifactId>
          </dependency>
          </attribute>
          </attributes>
          </configuration>

          Show
          Mike Youngstrom added a comment - I think that being able to specify an attribute to apply to all dependencies would work in the aspectj case so the addition of that functionality would be great at a minimum. Though perhaps in the future I think it would be nice to specify attributes for individual dependencies as well for other plugins in the eclipse plugin configuration xml. I don't know much about how maven plugin development works but such configuration could perhaps look like: <configuration> <attributes> <attribute name="some.attribute.name" value="attributeValue"> <dependency> <groupId>some.group</groupId> <artifactId>someArtifact</artifactId> </dependency> </attribute> </attributes> </configuration>
          Hide
          Cris Daniluk added a comment -

          I think it would be handy to submit a patch to allow for global attributes on deps. I still think that customizing on a dep-by-dep basis would be best done in the dep config, not in the plugin config, since you'd have to duplicate so much effort. I would be happy to submit a patch that improves upon MECLIPSE-264 to make this support more flexible. It would be helpful if someone incorporated that patch first, though... is anybody actively committing?

          Show
          Cris Daniluk added a comment - I think it would be handy to submit a patch to allow for global attributes on deps. I still think that customizing on a dep-by-dep basis would be best done in the dep config, not in the plugin config, since you'd have to duplicate so much effort. I would be happy to submit a patch that improves upon MECLIPSE-264 to make this support more flexible. It would be helpful if someone incorporated that patch first, though... is anybody actively committing?
          Hide
          Christian Hall added a comment -

          Can someone outline what it would take to fix this issue? Is it something that someone new to the source code could create a patch for?

          This feature is pretty critical if components are dependent on externally compiled aspects in the maven repo. I know very little about the M2Eclipse support as well, but I would think in adding this feature it would be good to make sure it works for that aspect of the plug-in as well.

          I'd be happy to look into this if I can carve out some time, but I don't know what I am offering having not seen the code base. If there is some way for a newbie to help with this, let me know.

          Show
          Christian Hall added a comment - Can someone outline what it would take to fix this issue? Is it something that someone new to the source code could create a patch for? This feature is pretty critical if components are dependent on externally compiled aspects in the maven repo. I know very little about the M2Eclipse support as well, but I would think in adding this feature it would be good to make sure it works for that aspect of the plug-in as well. I'd be happy to look into this if I can carve out some time, but I don't know what I am offering having not seen the code base. If there is some way for a newbie to help with this, let me know.
          Hide
          Eric Berry added a comment - - edited

          I have created a patch that includes tests and examples that implement ajdt. Someone please take a look and see if it can be incorporated.

          Show
          Eric Berry added a comment - - edited I have created a patch that includes tests and examples that implement ajdt. Someone please take a look and see if it can be incorporated.
          Hide
          Eric Berry added a comment -

          The patch is included in MECLIPSE-200

          Show
          Eric Berry added a comment - The patch is included in MECLIPSE-200
          Hide
          Arnaud Heritier added a comment -

          Fixed with MECLIPSE-200

          Show
          Arnaud Heritier added a comment - Fixed with MECLIPSE-200

            People

            • Assignee:
              Arnaud Heritier
              Reporter:
              Mike Youngstrom
            • Votes:
              25 Vote for this issue
              Watchers:
              22 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: