-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid generation of SCR component xml after update to 2403 #1235
Comments
Thanks for this report, I can confirm that this happens. |
activate is the default see the Specification:
also see here
There are also numerous examples in the specification that show this pattern, therefore the component.xml is valid and the generator just removes redundant information now. |
Ok, I was under the impression that it was needed to be called. But in the same vein, why isn't this also happening for deactivate for which the specification is similar and the case in the image does have one of those. |
The code is somewhat brittle and far from perfect, most likely it is not (yet) implemented that way, in the end you should considered to not check in the generated XMLs at all and let them generated by Tycho/PDE instead that way you won't notice subtile differences in the generated output. |
That is an idea, but IMHO that kind of breaks with building exactly what you committed and tested. |
So you check in compiled class files into version control as well? :-) |
I think you know what I meant, these are still sources. |
Only if you edit them by hand, if you use annotations (like here) the java files are the source of the result, just that it is a readable xml in contrast to a binary class file format. |
Ok I'll buy that. Thanks |
Well I guess there is more to this than just removing the files from git.
The only thing I found is this issue on github , where it seems to have a preference file in .settings and the build properties that contains a reference to the component. I am using workspace level setting so I don't have any file at the project level and the build.properties only specifies OSGI-INF/, . So what am I missing here? Thanks |
The problem is that you can't version a folder, the usual workaround is to have a https://github.com/eclipse-m2e/m2e-core/tree/master/org.eclipse.m2e.core/OSGI-INF |
I did that but no success Error: And here is what is there from git:
Any idea what else is required? |
Have you enabled the tycho-ds-plugin or checked in the org.eclipse.pde.ds.annotations.prefs? |
Wow I finally got it done, but for one project. We have our own org.eclipse.birt.report.viewer based on an older 4.7 version and I am getting errors about the component XML not being found after the DS plugin has run. I can see that it is valid and included in the manifest. For now I have removed the .gitignore on this project but would still like to handle it like all other 350 projects. This project has no project specific DS annotation, but it does have specific project PDE settings. |
Can you share an example where it is not working? |
I've been looking to try to identify what is different (and it is indeed different that our other projects), short of sharing the whole project. I looked at .project, .classpath and nothing special there except for 2 source location The manifest is pretty standard except this part that has some more exotic options:
Also the build.properties is different:
But something interesting looking at the build log.
And then later we have in packaging (after tycho-ds:4.0.7:declarative-services as run) :
We can see that the packaging of the jar that has the DS component goes through without errors, but then it has issues packaging the viewservlets.jar Does that help? |
Surely not a Tycho issue, but more general PDE. While removing the component XML from git, they all got deleted locally along with adding the .gitignore files. I ended up with problems running the application until I discovered 1 project where the component XML had not been generated. The Service-Component directive (only 1 component in this bundle) was in the Manifest but the file wasn't there. Clean & rebuild didn't work. I remove the manifest Service-Component entry and the entry got re-added as expected. There is a single workspace level configuration for PDE DS annotations and I can confirm that to be true here as well. At the end, I had to recreate the file manually in order to work with the application again. |
If that happens it should work that you touch the java file once. |
Believe me I did, I even removed the @component and re-added it. It worked for the manifest but not the XML |
Then this is a bug, there is some code that checks if the file is different and then don't write it again, the only think I could think of is that it was out of sync somehow with a bad cached state. |
We are getting hundreds of changed xml files after a rebuild. Cleared those up but keep coming back.
The change is that it is removing the activate method registration
The text was updated successfully, but these errors were encountered: