maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject RE: Should I disable maven-compiler-plugin when using aspectj-maven-compiler?
Date Wed, 13 Jan 2016 13:10:49 GMT
  take a look athttp://dev.eclipse.org/viewcvs/index.cgi/org.aspectj/?root=Tools_Project
find your way to this artifact:<groupId>org.aspectj</groupId>  <artifactId>aspectjtools</artifactId>
 <packaging>jar</packaging>  <version>1.8.5</version>  <name>AspectJ
tools</name>  <description>Tools from the AspectJ project</description>
 <url>http://www.aspectj.org</url>
take a gander at AjcTask.java and notice the setting of javac arg called 'proc'
/**   * Controls whether annotation processing and/or compilation is done.   * -proc:none
means that compilation takes place without annotation processing.   * -proc:only means that
only annotation processing is done, without any subsequent compilation.   */  public void
setProc(String proc) {    if (proc.equals("none")) {      cmd.addFlag("-proc:none", true);
   } else if (proc.equals("only")) {      cmd.addFlag("-proc:only", true);    }  }
-proc: {none,only}Controls whether annotation processing and/or compilation is done. -proc:none
means that compilation takes place without annotation processing. -proc:only means that only
annotation processing is done, without any subsequent compilation.
javac -proc:only (needs to be set on any phase before compile such as generate-sources) within
aspectj environment this is enabled by argument -Dorg.eclipse.jdt.core.compiler.generateClassFiles
on command line

javac -proc:none(needs to be set only on compile phase) -Dorg.eclipse.jdt.core.compiler.generateClassFiles
absent on command line

HTH
Martin                                                                                   
            


> Date: Wed, 13 Jan 2016 13:42:53 +0200
> Subject: Re: Should I disable maven-compiler-plugin when using aspectj-maven-compiler?
> From: dagansandler@gmail.com
> To: users@maven.apache.org
> 
> Both, actually.
> In any case, using aspectj compiler through the maven-compiler-plugin seems
> to be causing more issues (it depends on an older version of aspectj tools,
> and raising it causes API errors) so it's definitely not the way for me.
> 
> I'm guessing my issue comes mainly from the fact that maven-compiler-plugin
> 3.1+ has an issue with incremental compilation, so a workaround is
> mandatory in the current situation...
> It is indeed peculiar that there isn't more info on that matter but then
> again I'm not sure how many people use aspectj and maven together
> 
> Doing some more google work brought me to these:
> -
> http://stackoverflow.com/questions/14614446/how-do-i-disable-the-maven-compiler-plugin
> -
> http://stackoverflow.com/questions/24211943/aspectj-maven-plugin-declare-soft-how-to-compile
> - https://dev.eclipse.org/mhonarc/lists/aspectj-users/msg14431.html
> 
> The last one is actually a post from the aspectj-users mailing list from
> about 2 years ago, asking about the same issue, although the person didn't
> seem to get a response.
> 
> 
> 
> 
> On Wed, Jan 13, 2016 at 11:35 AM, Anders Hammar <anders@hammar.net> wrote:
> 
> > >
> > > Does this act differently though than the aspectj-maven-plugin? Does it
> > > play well with AJDT and eclipse?
> > >
> >
> > I don't know; I don't use aspectj. Couldn't find any pointers on this in
> > the aspact-maven-plugin docs so it might be the wrong path. However,
> > couldn't find any instructions on using your workaround either...:-)
> > As you stated "aspectj-compiler-plugin" in the subject, I thought that you
> > wanted to use the aspectj compiler. But maybe I misunderstood and you just
> > want to weave with aspectj?
> >
> > /Anders
> >
> >
> > >
> > >
> > > On Wed, Jan 13, 2016 at 10:59 AM, Anders Hammar <anders@hammar.net>
> > wrote:
> > >
> > > > Can't you just tell maven-compiler-plugin to use the aspectj compiler?
> > > >
> > > >
> > >
> > https://maven.apache.org/plugins/maven-compiler-plugin/non-javac-compilers.html
> > > >
> > > > /Anders
> > > >
> > > > On Wed, Jan 13, 2016 at 9:41 AM, Dagan Sandler <dagansandler@gmail.com
> > >
> > > > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I am in the process of updating my plugin definitions in all of the
> > > > > projects I manage.
> > > > > Notably, I tried updating maven-compiler-plugin from 2.5.1 to 3.3
but
> > > > > encountered an issue in a project that uses aspectj-maven-plugin.
> > > > >
> > > > > The issue is, it seems, that the maven-compiler-plugin is invoked
> > > before
> > > > > the aspectj-maven-plugin, and causes the build to fail.
> > > > >
> > > > > I have previously used a workaround for this issue by setting the
> > > > > aspectj-maven-plugin to execute in phase process-sources, so it's
> > > invoked
> > > > > before the maven plugin
> > > > > However, in maven-compiler-plugin 3.1+ there's this bug
> > > > > <https://issues.apache.org/jira/browse/MCOMPILER-209> which
causes
> > the
> > > > > maven-compiler-plugin to recompile all sources and to fail the build,
> > > so
> > > > > you must set useIncrementalCompilation to *false*
> > > > >
> > > > > Another workaround I found before finding out about the incremental
> > > build
> > > > > bug, is to disable the maven-compiler-plugin altogether in that
> > project
> > > > and
> > > > > let aspectj-maven-plugin do all the compilation by adding
> > > > > <execution>
> > > > > <id>default-compile</id>
> > > > > <phase>none</phase>
> > > > > </execution>
> > > > > to the maven-compiler-plugin definition
> > > > >
> > > > > Anyone knows the downsides of any of these workarounds? Is there
> > > another
> > > > > configuration that I should be using instead of these options?
> > > > >
> > > >
> > >
> >
 		 	   		  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message