Hi,
2009/8/7 levko <[email protected]> > > Hi Clement, > > Thank you for the prompt reply. > > > clement escoffier wrote: > > > > It seems that Eclipse has not already compiled the component classes when > > the bundle is built. You can try to close and re-open the project. > > > Actually, I used already working bundle built by using another iPOJO ant > task, which manipulates bundle.jar, created from classes compiled by > Eclipse; manipulated bundle.jar is unpackaged back to the bin folder > replacing original classes with manipulated versions. The only target I've > excluded from the build.xml is 'compile', since original version of classes > is compiled by Eclipse (see also http://grakol.com/wordpress/?p=120). > I also tried 'clean' experiment, starting from original classes compiled by > Eclipse and original Manifest that does not contain any iPOJO stuff. The > result is the same - build fails with messages like this: > [ipojo] The component ....class is declared but not in the bundle > > > clement escoffier wrote: > > > > You can also try to import the following project inside your Eclipse: > > http://people.apache.org/~clement/ipojo/MyiPOJOBundle-1.4.0.zip<http://people.apache.org/%7Eclement/ipojo/MyiPOJOBundle-1.4.0.zip> > > > I looked at the build.xml file in the new version - it specifies 'package' > as its default target and does not run the 'manipulate' target. I tried to > change the default target to 'manipulate' and make this target depend on > 'compile' to make sure the classes are created. As the result, the build > fails with the following log: > clean: > [delete] Deleting directory ...\MyiPOJOBundle-1.4.0\bin > compile: > [mkdir] Created dir: ...\MyiPOJOBundle-1.4.0\bin > [javac] Compiling 1 source file to ...\MyiPOJOBundle-1.4.0\bin > manipulate: > [ipojo] Input directory : ...\MyiPOJOBundle-1.4.0\bin > [ipojo] Metadata file : ...\MyiPOJOBundle-1.4.0\metadata.xml > [ipojo] Start manipulation > [ipojo] The component > org/apache/felix/ipojo/sample/MyComponentImpl.class is declared but not in > the bundle > > BUILD FAILED > ...\MyiPOJOBundle-1.4.0\build.xml:54: The component > org/apache/felix/ipojo/sample/MyComponentImpl.class is declared but not in > the bundle > > Total time: 1 second > > Line 54 in the build.xml file is the end of iPOJO ant task in the > 'manipulate' target. The eclipse builder uses the 'manipulate' target. (Project Properties - Builders - MyiPOJOBundle - targets. So, it manipulates classes generated by eclipse and updates the manifest everytime you change something in your project. You don't need to call ant yourself, Eclipse does that for you. The builld.xml file specifies 'package' as the default target because it is used (at least by me) to really generate the 'final' bundle. It can use either classes already compiled by Eclipse ('ant package'), or can launch javac with 'ant compile package'. So if you want to launch Ant manually, without the Eclipse compiled classes, launch 'ant compile package'. If you want to reuse compiled classes (from Eclipse), check that classes are already compiled (in the Eclipse output folder (bin by default)) and then launch 'ant package'. Last way, configure an Ant builder (so, you don't have to launch ant manually) in your eclipse project using the 'manipulate' target. Regards, Clement > > > Thanks, > -- Lev > -- > View this message in context: > http://www.nabble.com/Running-iPOJO-ant-task-in-Eclipse-tp24855448p24865293.html > Sent from the Apache Felix - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >

