You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Josh Beitelspacher (JIRA)" <ji...@apache.org> on 2012/10/17 20:40:03 UTC

[jira] [Created] (CXF-4581) cxf-codegen-plugin tries to generate code during "configuration" build

Josh Beitelspacher created CXF-4581:
---------------------------------------

             Summary: cxf-codegen-plugin tries to generate code during "configuration" build
                 Key: CXF-4581
                 URL: https://issues.apache.org/jira/browse/CXF-4581
             Project: CXF
          Issue Type: Bug
          Components: Tooling
            Reporter: Josh Beitelspacher


In order to configure the workspace, m2e runs a "configuration" build prior to any actual builds. During this "configuration" builds plugins should only setup their additional source and resources directories and should not attempt to read or write any files in the workspace.

In many cases it is not a problem that code generation runs too soon, but if any input files to the code generation process are not available then the code generation will fail, the target/generated-sources/cxf directory will not be created, and the generated-sources directory won't be added to Eclipse classpath.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4581) cxf-codegen-plugin tries to generate code during "configuration" build

Posted by "Josh Beitelspacher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13488428#comment-13488428 ] 

Josh Beitelspacher commented on CXF-4581:
-----------------------------------------

I should have been more clear in my comment. This change only affects incremental builds inside Eclipse. When building from the command line cxf-codegen-plugin will continue to check for changes in externally referenced files during every build.

When the cxf-codegen-plugin is called during an Eclipse incremental build, the cxf-codegen-plugin will also check for changes in externally referenced files. The problem is that changing one of the externally referenced files inside Eclipse won't actually trigger an increment build. The user has to touch a file or run "Project -> Clean..." in Eclipse to trigger a clean (which will immediately be followed by an automatic rebuild). The attached patch doesn't address this problem because there is no easy way to solve it. Instead of mentioning this issue in the comments I should probably have opened a new issue for it.

All the attached patch does is prevent the cxf-codegen-plugin from trying to generate code during the m2e configuration build. It shouldn't have any impact at all when mvn is run from the command line.
                
> cxf-codegen-plugin tries to generate code during "configuration" build
> ----------------------------------------------------------------------
>
>                 Key: CXF-4581
>                 URL: https://issues.apache.org/jira/browse/CXF-4581
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>            Reporter: Josh Beitelspacher
>         Attachments: 0001-CXF-4581-Prevent-code-generation-during-m2e-incremen.patch
>
>
> In order to configure the workspace, m2e runs a "configuration" build prior to any actual builds. During this "configuration" builds plugins should only setup their additional source and resources directories and should not attempt to read or write any files in the workspace.
> In many cases it is not a problem that code generation runs too soon, but if any input files to the code generation process are not available then the code generation will fail, the target/generated-sources/cxf directory will not be created, and the generated-sources directory won't be added to Eclipse classpath.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4581) cxf-codegen-plugin tries to generate code during "configuration" build

Posted by "Josh Beitelspacher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13478215#comment-13478215 ] 

Josh Beitelspacher commented on CXF-4581:
-----------------------------------------

As a workaround, it would be helpful to move the calls to MavenProject.addCompileSourceRoot() and MavenProject.addTestCompileSourceRoot() to the start of the Mojo's execute() method. This would ensure that the generated source directories are added to the Eclipse classpath.

I also opened an issue against m2e (https://bugs.eclipse.org/bugs/show_bug.cgi?id=392211), because plugins really need a way to be able to determine the difference between "configuration" builds and normal builds in order to "do the right thing."
                
> cxf-codegen-plugin tries to generate code during "configuration" build
> ----------------------------------------------------------------------
>
>                 Key: CXF-4581
>                 URL: https://issues.apache.org/jira/browse/CXF-4581
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>            Reporter: Josh Beitelspacher
>
> In order to configure the workspace, m2e runs a "configuration" build prior to any actual builds. During this "configuration" builds plugins should only setup their additional source and resources directories and should not attempt to read or write any files in the workspace.
> In many cases it is not a problem that code generation runs too soon, but if any input files to the code generation process are not available then the code generation will fail, the target/generated-sources/cxf directory will not be created, and the generated-sources directory won't be added to Eclipse classpath.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CXF-4581) cxf-codegen-plugin tries to generate code during m2e "configuration" build

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-4581.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.7.1
                   2.6.4
         Assignee: Daniel Kulp

Patch applied.  Thanks!
                
> cxf-codegen-plugin tries to generate code during m2e "configuration" build
> --------------------------------------------------------------------------
>
>                 Key: CXF-4581
>                 URL: https://issues.apache.org/jira/browse/CXF-4581
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>            Reporter: Josh Beitelspacher
>            Assignee: Daniel Kulp
>             Fix For: 2.6.4, 2.7.1
>
>         Attachments: 0001-CXF-4581-Prevent-code-generation-during-m2e-incremen.patch
>
>
> In order to configure the workspace, m2e runs a "configuration" build prior to any actual builds. During a "configuration" build plugins should only setup their additional source and resources directories and should not attempt to read or write any files in the workspace.
> In many cases it is not a problem that code generation runs too soon, but if any input files to the code generation process are not available then the code generation will fail, the target/generated-sources/cxf directory will not be created, and the generated-sources directory won't be added to Eclipse classpath.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4581) cxf-codegen-plugin tries to generate code during "configuration" build

Posted by "Glen Mazza (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13488222#comment-13488222 ] 

Glen Mazza commented on CXF-4581:
---------------------------------

quote: "Users that configure CXF to use external resources just need to be aware that the codegen plugin will only be executed when a file within the project is updated or an Eclipse clean is run."

The codegen plugin should be IDE-independent, so I think you mean an "mvn clean", not an "mvn eclipse:clean", right?  But the limitation that "the codegen plugin will only be executed when a file within the project is updated" seems too strict, because what if one of the externally referenced files change?  I would think Codegen should be detecting that and regenerating artifacts as a result.

                
> cxf-codegen-plugin tries to generate code during "configuration" build
> ----------------------------------------------------------------------
>
>                 Key: CXF-4581
>                 URL: https://issues.apache.org/jira/browse/CXF-4581
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>            Reporter: Josh Beitelspacher
>         Attachments: 0001-CXF-4581-Prevent-code-generation-during-m2e-incremen.patch
>
>
> In order to configure the workspace, m2e runs a "configuration" build prior to any actual builds. During this "configuration" builds plugins should only setup their additional source and resources directories and should not attempt to read or write any files in the workspace.
> In many cases it is not a problem that code generation runs too soon, but if any input files to the code generation process are not available then the code generation will fail, the target/generated-sources/cxf directory will not be created, and the generated-sources directory won't be added to Eclipse classpath.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4581) cxf-codegen-plugin tries to generate code during m2e "configuration" build

Posted by "Josh Beitelspacher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Josh Beitelspacher updated CXF-4581:
------------------------------------

    Description: 
In order to configure the workspace, m2e runs a "configuration" build prior to any actual builds. During a "configuration" build plugins should only setup their additional source and resources directories and should not attempt to read or write any files in the workspace.

In many cases it is not a problem that code generation runs too soon, but if any input files to the code generation process are not available then the code generation will fail, the target/generated-sources/cxf directory will not be created, and the generated-sources directory won't be added to Eclipse classpath.

  was:
In order to configure the workspace, m2e runs a "configuration" build prior to any actual builds. During this "configuration" builds plugins should only setup their additional source and resources directories and should not attempt to read or write any files in the workspace.

In many cases it is not a problem that code generation runs too soon, but if any input files to the code generation process are not available then the code generation will fail, the target/generated-sources/cxf directory will not be created, and the generated-sources directory won't be added to Eclipse classpath.

    
> cxf-codegen-plugin tries to generate code during m2e "configuration" build
> --------------------------------------------------------------------------
>
>                 Key: CXF-4581
>                 URL: https://issues.apache.org/jira/browse/CXF-4581
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>            Reporter: Josh Beitelspacher
>         Attachments: 0001-CXF-4581-Prevent-code-generation-during-m2e-incremen.patch
>
>
> In order to configure the workspace, m2e runs a "configuration" build prior to any actual builds. During a "configuration" build plugins should only setup their additional source and resources directories and should not attempt to read or write any files in the workspace.
> In many cases it is not a problem that code generation runs too soon, but if any input files to the code generation process are not available then the code generation will fail, the target/generated-sources/cxf directory will not be created, and the generated-sources directory won't be added to Eclipse classpath.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4581) cxf-codegen-plugin tries to generate code during m2e "configuration" build

Posted by "Josh Beitelspacher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Josh Beitelspacher updated CXF-4581:
------------------------------------

    Summary: cxf-codegen-plugin tries to generate code during m2e "configuration" build  (was: cxf-codegen-plugin tries to generate code during "configuration" build)
    
> cxf-codegen-plugin tries to generate code during m2e "configuration" build
> --------------------------------------------------------------------------
>
>                 Key: CXF-4581
>                 URL: https://issues.apache.org/jira/browse/CXF-4581
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>            Reporter: Josh Beitelspacher
>         Attachments: 0001-CXF-4581-Prevent-code-generation-during-m2e-incremen.patch
>
>
> In order to configure the workspace, m2e runs a "configuration" build prior to any actual builds. During this "configuration" builds plugins should only setup their additional source and resources directories and should not attempt to read or write any files in the workspace.
> In many cases it is not a problem that code generation runs too soon, but if any input files to the code generation process are not available then the code generation will fail, the target/generated-sources/cxf directory will not be created, and the generated-sources directory won't be added to Eclipse classpath.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4581) cxf-codegen-plugin tries to generate code during "configuration" build

Posted by "Josh Beitelspacher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Josh Beitelspacher updated CXF-4581:
------------------------------------

    Attachment: 0001-CXF-4581-Prevent-code-generation-during-m2e-incremen.patch

The attached patch resolves the issue by adding the generated sources to the classpath first and then aborting the build if no deltas are detected in the project.

m2e-compatible Maven plugins should really only operate on files within the project, but the CXF codegen plugin is capable of pulling files from arbitrary URLs (including classpath and http URLs). In this scenario ensuring that the build will be triggered at the appropriate times is not possible unless you write an m2e connector. This patch just stops the build from running at inappropriate times, but doesn't address the root problem.

However, I believe this patch should work well enough to satisfy most users. Users that configure CXF to use external resources just need to be aware that the codegen plugin will only be executed when a file within the project is updated or an Eclipse clean is run.
                
> cxf-codegen-plugin tries to generate code during "configuration" build
> ----------------------------------------------------------------------
>
>                 Key: CXF-4581
>                 URL: https://issues.apache.org/jira/browse/CXF-4581
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>            Reporter: Josh Beitelspacher
>         Attachments: 0001-CXF-4581-Prevent-code-generation-during-m2e-incremen.patch
>
>
> In order to configure the workspace, m2e runs a "configuration" build prior to any actual builds. During this "configuration" builds plugins should only setup their additional source and resources directories and should not attempt to read or write any files in the workspace.
> In many cases it is not a problem that code generation runs too soon, but if any input files to the code generation process are not available then the code generation will fail, the target/generated-sources/cxf directory will not be created, and the generated-sources directory won't be added to Eclipse classpath.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira