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 Thu, 14 Jan 2016 22:18:08 GMT



                                                                                         
          


> Date: Thu, 14 Jan 2016 09:21:41 +0200
> Subject: Re: Should I disable maven-compiler-plugin when using aspectj-maven-compiler?
> From: dagansandler@gmail.com
> To: users@maven.apache.org
> 
> Sorry if you were offended for some reason, but let's look at it
> objectively:
> 
> 1) I ask a question, you post an answer with a link to a website that
> contains a message that it was migrated to a different location. Since I
> don't really know what you thought was there, I can't really guess where to
> find this new locationMG>I respectfully asked the site admin where the aspectj is
now located and he responded immediatelyMG>http://git.eclipse.org/c/aspectj/org.aspectj.git
> 
> 2) While I haven't posted my entire configuration, I am asking this
> question on the Maven-Users mailing list, so I don't understand why you
> would need to "speculate" on if I'm using Maven/Gradle/Ant
MG>because alot of ASF folk are STILL using ant then I would suggest running it thru maven
plugin called
MG>maven-antrun-plugin which means the implementation will run with ANT and maven
> 
> 3) I have posted a description of the basic configuration I am using (2
> maven plugins in conjunction)

MG>should not use 2 different plugins in same phase when one phase (generate-sources) MG>to
generate the classes followed by the next phase (maven-compile-plugin) to compile the classes
 and was asking what is the best practice for
> using these side-by-side, or if it's necessary at all. As I wrote in my
> original message, I have valid workarounds that achieve what I need. All
> I'm asking is if someone knows if there are down/upsides to using either.
> 4) I am well capable of understanding what I need for my implementation and
> know how to write a working build script, thank you.
MG>then attach the pom.xml and eliminate guesswork/speculation on what your pom.xml is
supposed to look like
> 
> 5) For some reason, your messages are being sent with awful formatting,
> which I'm guessing isn't really your fault, but it makes it really hard to
> read, so I'm sorry if I misunderstood anything you were trying to say. Take
> a look here
> <https://www.mail-archive.com/users@maven.apache.org/msg137749.html>for
> example...MG>I have another email program I use for professional emails ..this is
a freebie mailer
MG>that ive used for past 20 years and have'nt had the heart to dump it yet
> 
> Finally, regardless of everything, I would still like to thank you for
> trying to help. I do appreciate it.MG>you're welcome
> 
> BR,
> Dagan.

MG>BR
> 
> 
> 
> 
> On Wed, Jan 13, 2016 at 6:09 PM, Martin Gainty <mgainty@hotmail.com> wrote:
> 
> >
> >
> >
> >
> > > Date: Wed, 13 Jan 2016 16:29:03 +0200
> > > Subject: Re: Should I disable maven-compiler-plugin when using
> > aspectj-maven-compiler?
> > > From: dagansandler@gmail.com
> > > To: users@maven.apache.org
> > >
> > > First, the link you gave redirects to a page saying CVS repositories have
> > > been migrated and it doesn't point forwardMG>complaining to the wrong
> > person
> > MG>KINDLY ask the site admin of the site where this information is now
> > hosted..MG>I would strongly suggest that your request to the site admin be
> > more respectful than you are to me here
> > >
> > > Second, the "proc" flag of the aspectj-maven-plugin is described also on
> > > the plugin's website
> > > http://www.mojohaus.org/aspectj-maven-plugin/compile-mojo.html#procMG>Glad
> > to hear that aspectj-maven-plugin has covered that base
> > >
> > > Third, I don't see how this answers my questions? And which workaround
> > does
> > > this apply to?MG>You have an approach which is the 30,000 foot view
> > which is what you need to go forwardMG>assuming you are using javac
> > compiler?MG>your end game is to implement javac with proc:only at some
> > earlier phase to generate the necessary classesMG>then later on in the
> > build cycle implement javac with proc:none at compile phase to do the
> > actual compile for the new classes
> > MG>The specific details on HOW you implement that using plain javac OR ANT
> > OR maven OR Gradle is up to you
> > MG>I dont know your environment since you didnt supply your environment
> > details
> > MG>also you did not supply your .gradle or build.xml or pom.xml so I
> > cannot speculate which specific tasks/plugins would be usedMG>as there are
> > 3 possible different distinctive ways to implement this solution
> > MG>if you dont understand implementation I would strongly suggest you
> > RESPECTFULLY ask a senior resource on your team
> > MG>to craft a build script which will achieve this objective within the
> > confines of your  .gradle/build.xml/pom.xml build environment
> > >
> > >
> > > On Wed, Jan 13, 2016 at 3:10 PM, Martin Gainty <mgainty@hotmail.com>
> > wrote:
> > >
> > > >   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