Skip to content

Commit a5e15d5

Browse files
committed
If the build POM does not have a reference to the flex framework, then
it cannot find the framework ZIP, and consequently the build does not include the correct namespaces section. This is the case when specifying the dependencies directly rather than through a frameowrk POM dependency (which has problems in maven because of the fact that it does not understand the custom scopes) By using some defaults and looking at other dependencies instead, we can fix this. Signed-off-by: Nigel Magnay <[email protected]>
1 parent 99b0ce6 commit a5e15d5

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

flexmojos-maven-plugin/src/main/java/net/flexmojos/oss/plugin/AbstractMavenMojo.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,10 @@ public String getFrameworkGroupId()
483483
if(frameworkArtifact != null) {
484484
return frameworkArtifact.getGroupId() + ".framework";
485485
}
486-
return null;
486+
487+
// This is a sensible default, and is what is always returned currently
488+
// from getFrameworkArtifact anyway.
489+
return "org.apache.flex.framework";
487490
}
488491

489492
public String getCompilerVersion()
@@ -501,7 +504,10 @@ public String getFrameworkArtifactVersion(String groupId, String artifactId)
501504
if(frameworkArtifact != null) {
502505
return frameworkArtifact.getVersion();
503506
}
504-
return null;
507+
508+
// Missing. Try framework version
509+
510+
return getFrameworkVersion();
505511
}
506512

507513
public Set<Artifact> getDependencies()

flexmojos-maven-plugin/src/main/java/net/flexmojos/oss/plugin/compiler/AbstractFlexCompilerMojo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2498,7 +2498,8 @@ public INamespace[] getNamespace()
24982498

24992499
if ( dir == null )
25002500
{
2501-
return this.namespaces;
2501+
getLog().error("Could not find framework. Namespaces not included in configuration; errors in the build may occur.");
2502+
return namespaces.toArray( new INamespace[namespaces.size()] );
25022503
}
25032504

25042505
Reader cfg = null;

0 commit comments

Comments
 (0)