Author: nbelaevski
Date: 2009-11-24 14:24:34 -0500 (Tue, 24 Nov 2009)
New Revision: 15991
Modified:
branches/community/3.3.X/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AssemblyLibraryMojo.java
branches/community/3.3.X/ui/assembly/pom.xml
branches/community/3.3.X/ui/assembly/src/main/assembly/richfaces.xml
Log:
Changes for inclusion of richfaces-impl-jsf2 into distribution archive
Modified:
branches/community/3.3.X/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AssemblyLibraryMojo.java
===================================================================
---
branches/community/3.3.X/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AssemblyLibraryMojo.java 2009-11-24
19:16:28 UTC (rev 15990)
+++
branches/community/3.3.X/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AssemblyLibraryMojo.java 2009-11-24
19:24:34 UTC (rev 15991)
@@ -50,6 +50,7 @@
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Model;
import org.apache.maven.model.Parent;
+import org.apache.maven.model.Profile;
import org.apache.maven.model.Resource;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
@@ -253,6 +254,11 @@
private String templateXpath;
/**
+ * @parameter
+ */
+ private boolean includeProjectDependencies = false;
+
+ /**
*
*/
public AssemblyLibraryMojo() {
@@ -503,6 +509,9 @@
private void setupGeneratedProject(
Map<String, Dependency> projectsDependencies)
throws MojoExecutionException {
+
+ Map localProjectDependencies = new HashMap();
+
Model generatedProject;
try {
MavenXpp3Reader reader = new MavenXpp3Reader();
@@ -510,10 +519,48 @@
} catch (Exception e1) {
throw new MojoExecutionException("Unable to read local POM", e1);
}
+
+ if (includeProjectDependencies) {
+ Set activeProfilesIds = new HashSet();
+ List activeProfiles = project.getActiveProfiles();
+ if (activeProfiles != null) {
+ for (Iterator activeProfilesItr = activeProfiles.iterator();
activeProfilesItr.hasNext(); ) {
+ Profile activeProfile = (Profile) activeProfilesItr.next();
+ activeProfilesIds.add(activeProfile.getId());
+ }
+ }
+
+ List dependencies = generatedProject.getDependencies();
+ if (dependencies != null) {
+ for (Iterator itr = dependencies.iterator(); itr.hasNext(); ) {
+ Dependency dependency = (Dependency) itr.next();
+ localProjectDependencies.put(dependency.getManagementKey(), dependency);
+ }
+ }
+
+ List profiles = generatedProject.getProfiles();
+ if (profiles != null) {
+ for (Iterator profilesItr = profiles.iterator(); profilesItr.hasNext(); ) {
+ Profile profile = (Profile) profilesItr.next();
+ if (activeProfilesIds.contains(profile.getId())) {
+ List profileDependencies = profile.getDependencies();
+ if (profileDependencies != null) {
+ for (Iterator itr = profileDependencies.iterator(); itr.hasNext(); ) {
+ Dependency dependency = (Dependency) itr.next();
+ localProjectDependencies.put(dependency.getManagementKey(), dependency);
+ }
+ }
+ }
+ }
+ }
+ }
+
generatedProject.getDependencies()
.addAll(projectsDependencies.values());
writePom(generatedProject);
- project.setDependencies(new
ArrayList<Dependency>(projectsDependencies.values()));
+
+ localProjectDependencies.putAll(projectsDependencies);
+ project.setDependencies(new
ArrayList<Dependency>(localProjectDependencies.values()));
// project.setFile(generatedPom);
}
Modified: branches/community/3.3.X/ui/assembly/pom.xml
===================================================================
--- branches/community/3.3.X/ui/assembly/pom.xml 2009-11-24 19:16:28 UTC (rev 15990)
+++ branches/community/3.3.X/ui/assembly/pom.xml 2009-11-24 19:24:34 UTC (rev 15991)
@@ -64,6 +64,7 @@
-->
<excludeXcss>**/basic.xcss, **/basic_classes.xcss, **/basic_both.xcss,
**/extended.xcss, **/extended_classes.xcss, **/extended_both.xcss, **/skin*.xcss,
**/tiny_mce/**, **/org/richfaces/renderkit/html/css/simple.xcss,
**/org/richfaces/renderkit/html/css/violetRays.xcss</excludeXcss>
<commonStyle>org/richfaces/skin.xcss</commonStyle>
+ <includeProjectDependencies>true</includeProjectDependencies>
</configuration>
<executions>
<execution>
@@ -430,6 +431,24 @@
</plugin>
</plugins>
</build>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-api</artifactId>
+ <version>3.3.3-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>3.3.3-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>3.3.3-SNAPSHOT</version>
+ <classifier>jsf2</classifier>
+ </dependency>
+ </dependencies>
</profile>
</profiles>
<dependencies />
Modified: branches/community/3.3.X/ui/assembly/src/main/assembly/richfaces.xml
===================================================================
--- branches/community/3.3.X/ui/assembly/src/main/assembly/richfaces.xml 2009-11-24
19:16:28 UTC (rev 15990)
+++ branches/community/3.3.X/ui/assembly/src/main/assembly/richfaces.xml 2009-11-24
19:24:34 UTC (rev 15991)
@@ -46,10 +46,11 @@
<dependencySet>
<outputDirectory>/lib</outputDirectory>
<unpack>false</unpack>
- <scope>runtime</scope>
+ <scope>compile</scope>
<includes>
<include>org.richfaces.framework:richfaces-api</include>
<include>org.richfaces.framework:richfaces-impl</include>
+ <include>org.richfaces.framework:richfaces-impl:*:jsf2</include>
<include>org.richfaces.framework:richfaces-test</include>
</includes>
<excludes>