On 5/25/07, Pramod Mahadev <[EMAIL PROTECTED]> wrote:

Here are the steps I had to take to get it to work but still unclear on a few
issues.

1) Move all the aspects (Java classes annotated with @Aspect) or classes
that are pure aspectJ i.e (declared as public aspect) and @Configurable
annotated classes to src/main/aspect folder. Not my desired approach. Still
cannot figure out how to get aspectJ compiler to weave classes in
src/main/java folder. I vastly appreciate if this problem can be solved.

Any time I add src/main/java in build.ajproperties referred to in
<ajdtBuildDefFile>build.ajproperties</ajdtBuildDefFile>, I get tons of
errors.

build.ajproperties
src.includes = src/main/aspect,src/main/java
src.excludes = src/test/,\
src/site/,\
src/main/assembly,\
src/main/filters,\
src/main/groovy


2) Add the following plugin to pom.xml and specify ajdtBuildDefFile to look
for build.ajproperties. Location of build.ajproperties is in the same
directory as pom.xml.

   <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
                <version>1.0-beta-2</version>
                <configuration>
                    <source>1.5</source>
                    <verbose>false</verbose>
                    <complianceLevel>1.5</complianceLevel>
                    <showWeaveInfo>true</showWeaveInfo>
                    <ajdtBuildDefFile>build.ajproperties</ajdtBuildDefFile>
                    <aspectLibraries>
                        <aspectLibrary>
                            <groupId>org.springframework</groupId>
                            <artifactId>spring-aspects</artifactId>
                        </aspectLibrary>
                    </aspectLibraries>
                    <outxml>true</outxml>
                </configuration>
                <executions>
                    <execution>

                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

3) My build.ajproperties is as follows:
src.includes = src/main/aspect
src.excludes = src/test/,\
src/site/,\
src/main/assembly,\
src/main/filters,\
src/main/groovy

Here again, any time I include src/main/java in src.includes, aspectj
compiler throws all sorts of errors.

4) One suggestion in the archetype for Spring+Hibernate or whereever would
be to provide a out of the box appfuse project to support the following
functionality now that AOP is gaining traction

I agree that it would be great to have this configured and ready to go
out-of-the-box. Can you please enter an issue in JIRA with the
suggestions below?

http://issues.appfuse.org/browse/APF

If you can contribute Java examples for @Configurable and @Aspect,
this will likely get in much faster. Please mark it fix for RC1 as
well.

Thanks!

Matt


1) Support a domain object with @Configurable and a dependency injected
spring bean in src/main/java folder.
2) A java class annotated with @Aspect (src/main/aspect folder)
3) A pure aspectJ aspect (src/main/aspect folder)
and last but not the least a pom.xml.

This will help many of us who are using appfuse as a starter to build our
application and simultaneously learning Spring,AspectJ, and Maven.

Please let me know if you can help me.
--
View this message in context: 
http://www.nabble.com/Having-trouble-getting-Dependency-Injection-to-work--%40Configurable---Newbie-Help-tf3689810s2369.html#a10808901
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
http://raibledesigns.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to