Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Issue with AJDT automatically adding aspect path to build path

aspectj,

The AJDT plugin automatically adds entries resolved on the aspect path
to the build path. I find this useful when individual jars are being
added to the classpath but it causes real usability issues when IvyDE
managed dependencies are used.

The issue arises when your depending on a library that has both regular
classes as well as aspects in the jar which is quite typical for an
aspect library. For such a situation, you will typically depend on some
coarse grained configuration for your classpath and a specific
configuration for your aspect path. The problem is that most times you
will end up with an error due to duplicate entries on the classpath.

Take the following as an example of such an aspect library:

<ivy-module version="2.0">
  <info organisation="co.uk.cooljeff" module="aspect-lib" rev="1.0.0"/>
  <configurations>
    <conf name="runtime" description="Core runtime dependencies." />
    <conf name="aspects" description="Binary aspects." />
  </configurations>
  <publications>
    <publication name="aspect-lib" type="jar" conf="runtime,aspects"/>
  </publications>
  <dependencies>
     ...
  </dependencies>
</ivy-module>

When depending on this library I would expect to do the following:

   * The project's classpath to depend on the "runtime" configuration.
   * The aspect path to depend on the "aspects" configuration.

The problem is that AJDT will automatically try to add the
aspect-lib.jar to the classpath which will cause Eclipse to throw an
error because the aspect-lib.jar is already there via the runtime ivy
configuration that was used for the classpath. 

Could the AJDT plugin be updated to either remove this automated
addition to the classpath or have a checkbox to turn off automatically
adding jars on the aspect path to the classpath?

Regards,

Jeff



Back to the top