More on component-info.xml usage
starksm64 May 14, 2005 1:43 PMI'm still struggling with how best to resolve dependency import notion in this issue:
http://jira.jboss.com/jira/browse/JBBUILD-72.
The problem I'm seeing is that there already is a notion of dependency, but it does not seem to be at the correct level. Its showing up in the main component build rather than the component-info.xml. Take for example, the jboss-head/naming/component-info.xml:
<project name="naming-component-info"> <component id="naming" module="jboss-naming" version="5.0-SNAPSHOT" > <artifact id="jnpserver.jar"/> <artifact id="jnp-client.jar"/> <artifact id="jnp-tests.jar"/> <export> <include input="jnpserver.jar"/> </export> </component> </project>
and the jboss-head/naming/jbossbuild.xml:
<?xml version="1.0"?> <project name="project" default="build" basedir="." > <import file="../tools/etc/jbossbuild/tasks.xml"/> <import file="component-info.xml"/> <componentdef component="naming" description="JBoss Naming"> <source id="main" rmic="**/NamingServer.class" > <include component="common"/> <include component="apache-log4j"/> <include component="junit-junit"/> </source> <artifactdef artifact="jnpserver.jar"> <include input="main"> <!-- include server classes & interfaces --> <include pattern="org/jnp/server/**"/> <include pattern="org/jnp/interfaces/**"/> </include> </artifactdef> <artifactdef artifact="jnp-client.jar"> <include input="main"> <!-- include client classes & server stubs --> <include pattern="org/jnp/interfaces/**"/> <include pattern="org/jnp/server/*Stub.class"/> </include> </artifactdef> <artifactdef artifact="jnp-tests.jar"> <include input="main"> <!-- only include test classes --> <include pattern="org/jnp/client/**"/> <include pattern="org/jnp/test/**"/> </include> </artifactdef> </componentdef> <!-- Generate the targets --> <generate generate="naming"/> </project>
So there is an expression of the thirdparty dependencies in the source id="main" element via the include component=common, apache-log4j, and junit-junit. This should be coming from the imported component-info.xml so that when the jnpserver.jar is promoted to the repository, consumers of the jnpserver.jar have the same thirdparty dependencies defined.
In this case, only the common and apache-log4j should be in expressed as dependencies in the component-info.xml as the junit-junit is local to the naming module unit testing. So something like the following component-info.xml:
<project name="naming-component-info"> <component id="naming" module="jboss-naming" version="5.0-SNAPSHOT" > <includes id="thirdparty"> <include component="common"/> <include component="apache-log4j"/> </includes> <artifact id="jnpserver.jar"/> <artifact id="jnp-client.jar"/> <artifact id="jnp-tests.jar"/> <export> <include input="jnpserver.jar"/> </export> </component> </project>
and componentdef/source is how this should be tying together:
<componentdef component="naming" description="JBoss Naming"> <source id="main" rmic="**/NamingServer.class" > <include includesref="thirdparty"/> <include component="junit-junit"/> </source>
right?