Skip to content

Commit

Permalink
Merge pull request #661 from TIBCOSoftware/2.9.2
Browse files Browse the repository at this point in the history
2.9.2
  • Loading branch information
richardyam-tibco authored May 18, 2022
2 parents 1d69621 + 82f2403 commit 2cfeb8f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Source/bw6-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tibco.plugins</groupId>
<artifactId>bw6-maven-plugin</artifactId>
<version>2.9.1</version>
<version>2.9.2</version>
<packaging>maven-plugin</packaging>
<name>Plugin Code for Apache Maven and TIBCO BusinessWorks™</name>
<description>Plugin Code for Apache Maven and TIBCO BusinessWorks™.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ private void addModules() throws Exception {
//This is necessary for the ear file to run properly
List<MavenProject> projects = parser.getModulesProjectSet();
Set<File> artifactFiles = new HashSet<File>();
for(MavenProject project : projects){
for(MavenProject moduleProject : projects){

Set<Artifact> dependencyArtifacts = project.getDependencyArtifacts();
Set<Artifact> dependencyArtifacts = moduleProject.getDependencyArtifacts();

for(Artifact artifact : dependencyArtifacts) {

Expand Down Expand Up @@ -248,10 +248,43 @@ private void addModules() throws Exception {
}

}

//add transitive dependencies of app module into EAR.
DependencyResolutionResult resolutionResult = getDependenciesResolutionResult(moduleProject);
if (resolutionResult != null) {
for(Dependency dependency : resolutionResult.getDependencies()) {
if(dependency.getArtifact().getVersion().equals("0.0.0")) { //$NON-NLS-1$
continue;
}

if(moduleVersionMap.containsKey(dependency.getArtifact().getArtifactId())){
continue;
}

Manifest mf = ManifestParser.parseManifestFromJAR( dependency.getArtifact().getFile() );

if(mf !=null){
for( Object str : mf.getMainAttributes().keySet())
{
getLog().debug( str.toString() );
if( "TIBCO-BW-SharedModule".equals(str.toString() ))
{
String dependencyVersion = BWProjectUtils.getModuleVersion(dependency.getArtifact().getFile());
moduleVersionMap.put(dependency.getArtifact().getArtifactId(), dependencyVersion);
artifactFiles.add(dependency.getArtifact().getFile());
break;

}
}
}

}
}

}

//This code takes dependencies in the application project and adds them to the EAR file root level
DependencyResolutionResult resolutionResult = getDependenciesResolutionResult();
DependencyResolutionResult resolutionResult = getDependenciesResolutionResult(project);
if (resolutionResult != null) {
for(Dependency dependency : resolutionResult.getDependencies()) {
if(dependency.getArtifact().getVersion().equals("0.0.0")) { //$NON-NLS-1$
Expand Down Expand Up @@ -333,7 +366,7 @@ private void addManifestJSON()

}

private DependencyResolutionResult getDependenciesResolutionResult() {
private DependencyResolutionResult getDependenciesResolutionResult(MavenProject project) {
DependencyResolutionResult resolutionResult = null;
try {
getLog().debug("Looking up dependency tree for the current project => " + project + " and the current session => " + session);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ else if(null != cEl.getAttributes().getNamedItem("assertionType") && "Activity".

String location = cEl.getAttributes().getNamedItem("Id").getNodeValue();
String activityName = cEl.getAttributes().getNamedItem("Name").getNodeValue();
ast.setActivityId(activityName);
ast.setLocation(location);

NodeList gChildNodes = cEl.getChildNodes();
Expand Down

0 comments on commit 2cfeb8f

Please sign in to comment.