[ 
https://issues.apache.org/jira/browse/AURORA-1146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15049291#comment-15049291
 ] 

John Sirois commented on AURORA-1146:
-------------------------------------

My response was confusing.  I can fix up annotation processing with an edit to 
build.gradle like so:
{noformat}
idea {
  project {
    vcs = 'Git'
    jdkName = '1.8'
    languageLevel = '1.8'

    // Turn on annotation processors for commons (uses commons-args) and aurora
    // (uses commons-args, forward, ...).  The crux here is _not_ turning 
annotation processing on
    // for commons-args (this leads to an attempt at self-processing before its 
processor is
    // compiled); so the strategy taken is to white-list modules.
    ipr {
      withXml {
        def projectNode = it.asNode()
        def compilerConfiguration = projectNode.find {
          it.name() == 'component' && it.@name == 'CompilerConfiguration'
        }
        def apt = compilerConfiguration.find { it.name() == 
'annotationProcessing' }
        apt.replaceNode {
          annotationProcessing {
            profile(default: 'true', name: 'Default', enabled: 'false')
            profile(default: 'false', name: 'apt', enabled: 'true') {
              sourceOutputDir(name: 'generated')
              sourceTestOutputDir(name: 'generated')
              processorPath(useClasspath: 'true')
              module(name: 'commons')
              module(name: 'aurora')
            }
          }
        }
      }
    }
  }
}
{noformat}

But that leads to the problem I describe above - the annotation processors run 
as expected and cmdline.arg.info.txt files are generated, but the run 
configuration for {{LocalSchedulerMain}} now includes an over-abundance of 
these files, picking up extras from commons/test and failing like so:
{noformat}
Dec 09, 2015 11:54:30 AM org.apache.aurora.common.args.apt.Configuration load
INFO: Loading @CmdLine config from: 
[file:/home/jsirois/dev/3rdparty/aurora/out/production/commons/org/apache/aurora/common/args/apt/cmdline.arg.info.txt.1,
 
file:/home/jsirois/dev/3rdparty/aurora/out/production/aurora/org/apache/aurora/common/args/apt/cmdline.arg.info.txt.2,
 
file:/home/jsirois/dev/3rdparty/aurora/out/test/commons/org/apache/aurora/common/args/apt/cmdline.arg.info.txt.2]
Dec 09, 2015 11:54:30 AM org.apache.aurora.scheduler.app.SchedulerMain exit
SEVERE: Failed to apply arguments
java.lang.IllegalArgumentException: Found 5 fields marked for @Positional Args 
after applying filter - only 1 is allowed:
        static final org.apache.aurora.common.args.Arg 
org.apache.aurora.common.args.ArgScannerTest$Main3.FILES
        static final org.apache.aurora.common.args.Arg 
org.apache.aurora.common.args.ArgScannerTest$StandardArgs.POSITIONAL
        static final org.apache.aurora.common.args.Arg 
org.apache.aurora.common.args.ArgScannerTest$Main3.PERCENTILES
        static final org.apache.aurora.common.args.Arg 
org.apache.aurora.common.args.ArgScannerTest$Main1.NAMES
        static final org.apache.aurora.common.args.Arg 
org.apache.aurora.common.args.ArgScannerTest$Main2.ROSTERS
java.lang.IllegalArgumentException: Found 5 fields marked for @Positional Args 
after applying filter - only 1 is allowed:
        static final org.apache.aurora.common.args.Arg 
org.apache.aurora.common.args.ArgScannerTest$Main3.FILES
        static final org.apache.aurora.common.args.Arg 
org.apache.aurora.common.args.ArgScannerTest$StandardArgs.POSITIONAL
        static final org.apache.aurora.common.args.Arg 
org.apache.aurora.common.args.ArgScannerTest$Main3.PERCENTILES
        static final org.apache.aurora.common.args.Arg 
org.apache.aurora.common.args.ArgScannerTest$Main1.NAMES
        static final org.apache.aurora.common.args.Arg 
org.apache.aurora.common.args.ArgScannerTest$Main2.ROSTERS
        at org.apache.aurora.common.args.Args.fromConfiguration(Args.java:128)
        at org.apache.aurora.common.args.ArgScanner.parse(ArgScanner.java:188)
        at org.apache.aurora.common.args.ArgScanner.parse(ArgScanner.java:166)
        at 
org.apache.aurora.scheduler.app.SchedulerMain.applyStaticArgumentValues(SchedulerMain.java:240)
        at 
org.apache.aurora.scheduler.app.local.LocalSchedulerMain.main(LocalSchedulerMain.java:75)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
{noformat}

> LocalSchedulerMain broken by JMH upgrade
> ----------------------------------------
>
>                 Key: AURORA-1146
>                 URL: https://issues.apache.org/jira/browse/AURORA-1146
>             Project: Aurora
>          Issue Type: Bug
>          Components: Build, Scheduler
>            Reporter: Kevin Sweeney
>
> Since the JMH patch the CmdLine annotation processor no longer runs in 
> IntelliJ, making it impossible to run LocalSchedulerMain. This looks likely 
> related to JMH adding its own annotation processor to the compile classpath.
> {noformat}
> commit 5542c556133bc1292e0a991b9db31f6465a83de8
> Author: Maxim Khutornenko <[email protected]>
> Date:   Thu Dec 11 11:57:09 2014 -0800
>     Adding JMH framework support for scheduler performance analysis.
>     
>     Reviewed at https://reviews.apache.org/r/28710/
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to