private GerApplicationType createDefaultPlan(Application application, JarFile module) {
// construct the empty geronimo-application.xml
GerApplicationType gerApplication = GerApplicationType.Factory.newInstance();
EnvironmentType environmentType = gerApplication.addNewEnvironment();
ArtifactType artifactType = environmentType.addNewModuleId();
artifactType.setGroupId(Artifact.DEFAULT_GROUP_ID);
// set the configId
String id = application != null ? application.getId() : null;
if (id == null) {
File fileName = new File(module.getName());
id = fileName.getName();
if (id.endsWith(".ear")) {
id = id.substring(0, id.length() - 4);
}
if (id.endsWith("/")) {
id = id.substring(0, id.length() - 1);
}
}
artifactType.setArtifactId(id);
artifactType.setVersion("" + System.currentTimeMillis());
artifactType.setType("car");
return gerApplication;
}