[
http://jira.codehaus.org/browse/MASPECTJ-78?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=255808#action_255808
]
Robert Scholte commented on MASPECTJ-78:
----------------------------------------
I don't agree with the suggested solution. The argumentsfile shows which
ajcOptions were passed to the {{runMain}} method. which could be really
helpful, especially when the ajc compile fails. If it's really a problem, the
solution must be found in redefining {{isBuildNeeded()}}.
In a CI build environment you should always start with a {{mvn clean}} to be
absolutely sure of a proper build, so I don't see why this could be a problem.
Since {{argumentFileName}} is a parameter it's even possible to have multiple
execution blocks within the same project without any problem.
So I'm thinking of closing this as {{won't fix}}.
> Arguments file is created despite of a failed compile
> -----------------------------------------------------
>
> Key: MASPECTJ-78
> URL: http://jira.codehaus.org/browse/MASPECTJ-78
> Project: Mojo AspectJ Plugin
> Issue Type: Bug
> Affects Versions: 1.3
> Reporter: Torsten Juergeleit
>
> In {{AbstractAjcCompiler.execute()}} the ajc arguments file is created before
> ajc is called. This argument file is used in
> {{AbstractAjcCompiler.isBuildNeeded()}} to check if calling ajc should be
> skipped if this arguments file already exists and holding the same same ajc
> arguments.
> This design will break if using this mojo in an CI build environment where
> the mojo is executed multiple times (without changing the aspects source
> code) and the ajc compile fails (due to errors in the aspects source code).
> In this case only the first build reports the ajc compile errors but the
> following builds will skip ajc due to the existance of the ajc argument file.
> This can easily fixed by creating the ajc argument file AFTER ajc was
> executed without any compile error, e.g.
> {code}
> getLog().debug( "Compiling and weaving " + resolvedIncludes.size() + "
> sources to " + getOutputDirectories().get( 0 ) );
> Main main = new Main();
> MavenMessageHandler mavenMessageHandler = new MavenMessageHandler( getLog() );
> main.setHolder( mavenMessageHandler );
> main.runMain( (String[]) ajcOptions.toArray( new String[0] ), false );
> IMessage[] errors = mavenMessageHandler.getMessages( IMessage.ERROR, true );
> if ( errors.length == 0 ) {
> try
> {
> File outDir = new File( (String) getOutputDirectories().get( 0 ) );
> AjcHelper.writeBuildConfigToFile( ajcOptions, argumentFileName,
> outDir );
> getLog().debug(
> "Argumentsfile written : "
> + new File( outDir.getAbsolutePath() +
> argumentFileName ).getAbsolutePath() );
> }
> catch ( IOException e )
> {
> throw new MojoExecutionException( "Could not write arguments file to
> the target area", e );
> }
> } else {
> if ( !proceedOnError )
> {
> throw new CompilationFailedException( errors );
> }
> }
> {code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email