}
ServiceDocument serviceDocument = ServiceDocument.Factory.newInstance();
ServiceType serviceType = serviceDocument.addNewService();
for (Iterator iterator = artifacts.iterator(); iterator.hasNext();) {
Artifact artifact = (Artifact) iterator.next();
Dependency dependency = artifact.getDependency();
if ("true".equals(dependency.getProperty(DEPENDENCY_PROPERTY))) {
String groupId = dependency.getGroupId();
String artifactId = dependency.getArtifactId();
String type = dependency.getType();
org.apache.geronimo.deployment.xbeans.ArtifactType dependencyType = serviceType.addNewDependency();
dependencyType.setGroupId(groupId);
dependencyType.setArtifactId(artifactId);
if ("true".equals(dependency.getProperty(KEEP_VERSION_PROPERTY))) {
String version = dependency.getVersion();
dependencyType.setVersion(version);
}
if (type != null && !"jar".equals(type)) {
dependencyType.setType(type);
}