Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 339DB108D0 for ; Fri, 27 Sep 2013 11:52:08 +0000 (UTC) Received: (qmail 78103 invoked by uid 500); 27 Sep 2013 11:52:04 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 77793 invoked by uid 500); 27 Sep 2013 11:52:03 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 77778 invoked by uid 99); 27 Sep 2013 11:52:02 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Sep 2013 11:52:02 +0000 Date: Fri, 27 Sep 2013 11:52:02 +0000 (UTC) From: "Stefan Egli (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FELIX-4246) SCR and Metatype descriptor files get deleted on subsequent (incremental) eclipse build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-4246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13779849#comment-13779849 ] Stefan Egli commented on FELIX-4246: ------------------------------------ FYI: Tested and verified, the files dont get deleted anymore with the latest fix. > SCR and Metatype descriptor files get deleted on subsequent (incremental) eclipse build > --------------------------------------------------------------------------------------- > > Key: FELIX-4246 > URL: https://issues.apache.org/jira/browse/FELIX-4246 > Project: Felix > Issue Type: Bug > Components: Maven SCR Plugin > Affects Versions: maven-scr-plugin 1.14.0 > Environment: Eclipse, m2eclipse > Reporter: Stefan Egli > Assignee: Carsten Ziegeler > Fix For: maven-scr-plugin 1.15.0, scr generator 1.8.2 > > > There's a regression bug introduced in maven-scr-plugin 1.14.0 which *worked fine in 1.13.0*. Consider the following scenario: > * a project is setup in eclipse/m2eclipse using the maven-scr-plugin 1.14.0 and contains java classes annotated with @Service and/or @Components > * the project is cleaned ('clean project') and built ('build project') > -> the descriptor .xml files are created as expected > * when the project is built again (incrementally, eg manually triggering another 'build project'), the descriptor .xml files are deleted > Some debugging narrows the problem down to the MavenProjectScanner.getSourcesForScanKind, where the buildContext.newScanner is invoked. The scanner returned there is of type EclipseBuildContext (set by m2eclipse) when doing a build right after a clean - and in this case the scanner finds java files, sets those via project.setSources and MetaTypeIO.generateDescriptors correctly generates the descriptors. > In the incremental(-eclipse)-build case though, the buildContext.newScanner returns an EclipseIncrementalBuildContext - which results in an empty set of sources being passed to project.setScanner, hence later down the call-stack MetaTypeIO.generateDescriptors gets an empty list of components, thus *thinks it's a good idea to go through the metatype directory and delete 'obsolete' metatype files* - when in fact they are not quite obsolete.. > Maybe it would be better to hook into the 'clean' method for deleting/cleaning up? -- 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