// parse vendor dd
GerApplicationClientType gerAppClient = getGeronimoAppClient(plan, moduleFile, standAlone, targetPath, appClient, earEnvironment);
EnvironmentType clientEnvironmentType = gerAppClient.getClientEnvironment();
Environment clientEnvironment = EnvironmentBuilder.buildEnvironment(clientEnvironmentType, defaultClientEnvironment);
if (standAlone) {
String name = new File(moduleFile.getName()).getName();
idBuilder.resolve(clientEnvironment, name + "_" + name, "jar");
} else {
Artifact earConfigId = earEnvironment.getConfigId();
idBuilder.resolve(clientEnvironment, earConfigId.getArtifactId() + "_" + targetPath, "jar");
}
EnvironmentType serverEnvironmentType = gerAppClient.getServerEnvironment();
Environment serverEnvironment = EnvironmentBuilder.buildEnvironment(serverEnvironmentType, defaultServerEnvironment);
if (!standAlone) {
EnvironmentBuilder.mergeEnvironments(earEnvironment, serverEnvironment);
serverEnvironment = earEnvironment;
if (!serverEnvironment.getConfigId().isResolved()) {
throw new IllegalStateException("Server environment module ID should be fully resolved (not " + serverEnvironment.getConfigId() + ")");
}
} else {
idBuilder.resolve(serverEnvironment, new File(moduleFile.getName()).getName(), "jar");
}
if (earName == null) {
earName = naming.createRootName(serverEnvironment.getConfigId(), NameFactory.NULL, NameFactory.J2EE_APPLICATION);
}
//always use the artifactId of the app client as the name component of the module name (on the server).
AbstractName moduleName = naming.createChildName(earName, clientEnvironment.getConfigId().toString(), NameFactory.APP_CLIENT_MODULE);
AbstractName clientBaseName = naming.createRootName(clientEnvironment.getConfigId(), clientEnvironment.getConfigId().toString(), NameFactory.J2EE_APPLICATION);