ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: IGNITE-1653
Date Fri, 23 Oct 2015 12:46:26 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1653 52df0fbcb -> b03ed4d73


IGNITE-1653


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b03ed4d7
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b03ed4d7
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b03ed4d7

Branch: refs/heads/ignite-1653
Commit: b03ed4d732fee108dc156469aca5c7311968d555
Parents: 52df0fb
Author: Anton Vinogradov <av@apache.org>
Authored: Fri Oct 23 15:46:17 2015 +0300
Committer: Anton Vinogradov <av@apache.org>
Committed: Fri Oct 23 15:46:17 2015 +0300

----------------------------------------------------------------------
 DEVNOTES.txt                          |   2 +-
 assembly/release-fabric-base.xml      |   9 --
 assembly/release-fabric-lgpl.xml      |  25 ++--
 assembly/release-fabric.xml           |  13 ++
 config/fabric-lgpl/default-config.xml |  29 ++++
 examples/README-lgpl.txt              |  33 +++++
 examples/README.txt                   |  21 ++-
 examples/pom-standalone-lgpl.xml      | 217 +++++++++++++++++++++++++++++
 examples/pom-standalone.xml           | 139 +++++++++---------
 examples/pom.xml                      | 161 ++++++++++-----------
 10 files changed, 464 insertions(+), 185 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b03ed4d7/DEVNOTES.txt
----------------------------------------------------------------------
diff --git a/DEVNOTES.txt b/DEVNOTES.txt
index a6c45f0..e8e3741 100644
--- a/DEVNOTES.txt
+++ b/DEVNOTES.txt
@@ -7,7 +7,7 @@ Without LGPL dependencies and Scala 2.10:
   mvn clean package -DskipTests -Dscala-2.10
 
 With LGPL dependencies:
-  mvn clean package -DskipTests -Prelease,lgpl
+  mvn clean package -DskipTests -Prelease,lgpl -Dignite.edition=fabric-lgpl
 
 With LGPL dependencies and Scala 2.10:
   mvn clean package -DskipTests -Prelease,lgpl -Dscala-2.10

http://git-wip-us.apache.org/repos/asf/ignite/blob/b03ed4d7/assembly/release-fabric-base.xml
----------------------------------------------------------------------
diff --git a/assembly/release-fabric-base.xml b/assembly/release-fabric-base.xml
index 825ac41..944e8ce 100644
--- a/assembly/release-fabric-base.xml
+++ b/assembly/release-fabric-base.xml
@@ -35,12 +35,6 @@
         </file>
 
         <file>
-            <source>examples/pom-standalone.xml</source>
-            <outputDirectory>/examples</outputDirectory>
-            <destName>pom.xml</destName>
-        </file>
-
-        <file>
             <source>examples/schema-import/pom-standalone.xml</source>
             <outputDirectory>/examples/schema-import</outputDirectory>
             <destName>pom.xml</destName>
@@ -79,7 +73,6 @@
                 <include>schema-import/src/**</include>
                 <include>schema-import/bin/**</include>
                 <include>schema-import/README.txt</include>
-                <include>README.txt</include>
             </includes>
         </fileSet>
 
@@ -103,8 +96,6 @@
             <excludes>
                 <exclude>**/package.html</exclude>
                 <exclude>src/test/**</exclude>
-                <exclude>config/hibernate/**</exclude>
-                <exclude>src/main/java-lgpl/**</exclude>
             </excludes>
         </fileSet>
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b03ed4d7/assembly/release-fabric-lgpl.xml
----------------------------------------------------------------------
diff --git a/assembly/release-fabric-lgpl.xml b/assembly/release-fabric-lgpl.xml
index 7995450..1766558 100644
--- a/assembly/release-fabric-lgpl.xml
+++ b/assembly/release-fabric-lgpl.xml
@@ -34,18 +34,17 @@
         <componentDescriptor>release-fabric-base.xml</componentDescriptor>
     </componentDescriptors>
 
-    <fileSets>
-        <fileSet>
-            <directory>examples</directory>
+    <files>
+        <file>
+            <source>examples/pom-standalone-lgpl.xml</source>
             <outputDirectory>/examples</outputDirectory>
-            <includes>
-                <include>config/hibernate/**</include>
-            </includes>
-        </fileSet>
-
-        <fileSet>
-            <directory>examples/src/main/java-lgpl</directory>
-            <outputDirectory>/examples/src/main/java</outputDirectory>
-        </fileSet>
-    </fileSets>
+            <destName>pom.xml</destName>
+        </file>
+
+        <file>
+            <source>examples/README-LGPL.txt</source>
+            <outputDirectory>/examples</outputDirectory>
+            <destName>README.txt</destName>
+        </file>
+    </files>
 </assembly>

http://git-wip-us.apache.org/repos/asf/ignite/blob/b03ed4d7/assembly/release-fabric.xml
----------------------------------------------------------------------
diff --git a/assembly/release-fabric.xml b/assembly/release-fabric.xml
index 403d3c9..ffde8ec 100644
--- a/assembly/release-fabric.xml
+++ b/assembly/release-fabric.xml
@@ -34,4 +34,17 @@
         <componentDescriptor>release-fabric-base.xml</componentDescriptor>
     </componentDescriptors>
 
+    <files>
+        <file>
+            <source>examples/pom-standalone.xml</source>
+            <outputDirectory>/examples</outputDirectory>
+            <destName>pom.xml</destName>
+        </file>
+
+        <file>
+            <source>examples/README.txt</source>
+            <outputDirectory>/examples</outputDirectory>
+            <destName>README.txt</destName>
+        </file>
+    </files>
 </assembly>

http://git-wip-us.apache.org/repos/asf/ignite/blob/b03ed4d7/config/fabric-lgpl/default-config.xml
----------------------------------------------------------------------
diff --git a/config/fabric-lgpl/default-config.xml b/config/fabric-lgpl/default-config.xml
new file mode 100644
index 0000000..5da95ba
--- /dev/null
+++ b/config/fabric-lgpl/default-config.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans
+       http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <!--
+        Alter configuration below as needed.
+    -->
+    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"/>
+</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/b03ed4d7/examples/README-lgpl.txt
----------------------------------------------------------------------
diff --git a/examples/README-lgpl.txt b/examples/README-lgpl.txt
new file mode 100644
index 0000000..0f95971
--- /dev/null
+++ b/examples/README-lgpl.txt
@@ -0,0 +1,33 @@
+Apache Ignite Examples
+======================
+
+This folder contains code examples for various Apache Ignite functionality.
+
+Examples are shipped as a separate Maven project, so to start running you simply need
+to import provided `pom.xml` file into your favourite IDE.
+
+The examples folder contains he following subfolders:
+
+- `config` - contains Ignite configuration files needed for examples.
+- `memcached` - contains PHP script demonstrating how Ignite Cache can be accessed using
Memcached client.
+- `rest` - contains PHP script demonstrating how Ignite Cache can be accessed via HTTP API.
+- `schema-import` - contains demo project for Apache Ignite Schema Import Utility. Refer
to enclosed
+  README.txt file for more information on how to build and run the demo.
+- `src/main/java` - contains Java examples for different Ignite modules and features.
+- `src/main/java8` - contains additional set of Java examples utilizing Java 8 lambdas. These
examples
+  are excluded by default, enable `java8` Maven profile to include them (JDK8 is required).
+- `src/main/scala` - contains examples demonstrating usage of API provided by Scalar.
+- `src/main/java-lgpl` - contains lgpl-based examples for different Ignite modules and features.
+
+
+Starting Remote Nodes
+=====================
+
+Remote nodes for examples should always be started with special configuration file which
enables P2P
+class loading: `examples/config/example-ignite.xml`. To run a remote node in IDE use `ExampleNodeStartup`
class.
+
+
+Java7 vs Java8
+===============
+Some examples (not all) which can benefit from Java8 Lambda support were re-written with
Java8 lambdas.
+For full set of examples, look at both Java7 and Java8 packages.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/b03ed4d7/examples/README.txt
----------------------------------------------------------------------
diff --git a/examples/README.txt b/examples/README.txt
index ed26b81..26970d6 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -15,8 +15,9 @@ The examples folder contains he following subfolders:
   README.txt file for more information on how to build and run the demo.
 - `src/main/java` - contains Java examples for different Ignite modules and features.
 - `src/main/java8` - contains additional set of Java examples utilizing Java 8 lambdas. These
examples
-  are excluded by default, enable `java8-examples` Maven profile to include them (JDK8 is
required).
+  are excluded by default, enable `java8` Maven profile to include them (JDK8 is required).
 - `src/main/scala` - contains examples demonstrating usage of API provided by Scalar.
+- `src/main/java-lgpl` - contains lgpl-based examples for different Ignite modules and features.
 
 
 Starting Remote Nodes
@@ -30,3 +31,21 @@ Java7 vs Java8
 ===============
 Some examples (not all) which can benefit from Java8 Lambda support were re-written with
Java8 lambdas.
 For full set of examples, look at both Java7 and Java8 packages.
+
+
+LGPL
+=====
+LGPL examples can be activated by turning lgpl profile on.
+
+lgpl profile required some lgpl-based libs, for example: ignite-hibernate & ignite-schedule.
+In case these libs can not be found by this maven project please download Apache Ignite sources
+at https://ignite.apache.org/download.cgi#sources.
+
+There are some ways to gain required libs from sources:
+
+1) Run "mvn clean install -DskipTests -P lgpl" at Apache Ignite sources.
+This case will install lgpl-based libs to local maven repository.
+
+2) Run "mvn clean package -DskipTests -Prelease,lgpl -Dignite.edition=fabric-lgpl" at Apache
Ignite sources.
+Required libs will appear at /target/release-package/libs/optional subfolders.
+Found libs should be copied to global or project's classpath.

http://git-wip-us.apache.org/repos/asf/ignite/blob/b03ed4d7/examples/pom-standalone-lgpl.xml
----------------------------------------------------------------------
diff --git a/examples/pom-standalone-lgpl.xml b/examples/pom-standalone-lgpl.xml
new file mode 100644
index 0000000..7e7ccc2
--- /dev/null
+++ b/examples/pom-standalone-lgpl.xml
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!--
+    POM file.
+-->
+<project
+    xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+
+        <!-- will be changed by profile activation. allows to combine profiles. -->
+        <lgpl.folder>src/main/java</lgpl.folder>
+        <java8.folder>src/main/java</java8.folder>
+        <java.ver>1.7</java.ver>
+    </properties>
+
+    <groupId>org.apache.ignite</groupId>
+    <artifactId>ignite-examples</artifactId>
+    <version>to_be_replaced_by_ignite_version</version>
+
+    <dependencies>
+        <dependency>
+            <groupId>javax.cache</groupId>
+            <artifactId>cache-api</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-core</artifactId>
+            <version>to_be_replaced_by_ignite_version</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-spring</artifactId>
+            <version>to_be_replaced_by_ignite_version</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-log4j</artifactId>
+            <version>to_be_replaced_by_ignite_version</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-indexing</artifactId>
+            <version>to_be_replaced_by_ignite_version</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.google.code.simple-spring-memcached</groupId>
+            <artifactId>spymemcached</artifactId>
+            <version>2.7.3</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>commons-codec</groupId>
+                    <artifactId>commons-codec</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
+
+    <profiles>
+        <profile>
+            <id>java8</id>
+
+            <properties>
+                <java8.folder>src/main/java8</java8.folder>
+                <java.ver>1.8</java.ver>
+            </properties>
+
+            <activation>
+                <jdk>[1.8,)</jdk>
+            </activation>
+        </profile>
+
+        <profile>
+            <id>scala</id>
+
+            <dependencies>
+                <dependency>
+                    <groupId>org.apache.ignite</groupId>
+                    <artifactId>ignite-scalar</artifactId>
+                    <version>to_be_replaced_by_ignite_version</version>
+                </dependency>
+            </dependencies>
+
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>net.alchim31.maven</groupId>
+                        <artifactId>scala-maven-plugin</artifactId>
+                        <version>3.2.0</version>
+                        <configuration>
+                            <jvmArgs>
+                                <jvmArg>-Xms512m</jvmArg>
+                                <jvmArg>-Xmx1024m</jvmArg>
+                            </jvmArgs>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>scala-compile-first</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>add-source</goal>
+                                    <goal>compile</goal>
+                                </goals>
+                            </execution>
+                            <execution>
+                                <id>scala-test-compile</id>
+                                <phase>process-test-resources</phase>
+                                <goals>
+                                    <goal>testCompile</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>lgpl</id>
+
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+
+            <properties>
+                <lgpl.folder>src/main/java-lgpl</lgpl.folder>
+            </properties>
+
+            <dependencies>
+                <dependency>
+                    <groupId>org.apache.ignite</groupId>
+                    <artifactId>ignite-hibernate</artifactId>
+                    <version>to_be_replaced_by_ignite_version</version>
+                </dependency>
+
+                <dependency>
+                    <groupId>org.apache.ignite</groupId>
+                    <artifactId>ignite-schedule</artifactId>
+                    <version>to_be_replaced_by_ignite_version</version>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/java</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+            <resource>
+                <directory>config</directory>
+            </resource>
+        </resources>
+
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.1</version>
+                <configuration>
+                    <source>${java.ver}</source>
+                    <target>${java.ver}</target>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>add-sources</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>schema-import/src/main/java</source>
+                                <source>${lgpl.folder}</source>
+                                <source>${java8.folder}</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/b03ed4d7/examples/pom-standalone.xml
----------------------------------------------------------------------
diff --git a/examples/pom-standalone.xml b/examples/pom-standalone.xml
index 045e088..6247ced 100644
--- a/examples/pom-standalone.xml
+++ b/examples/pom-standalone.xml
@@ -28,6 +28,11 @@
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+
+        <!-- will be changed by profile activation. allows to combine profiles. -->
+        <lgpl.folder>src/main/java</lgpl.folder>
+        <java8.folder>src/main/java</java8.folder>
+        <java.ver>1.7</java.ver>
     </properties>
 
     <groupId>org.apache.ignite</groupId>
@@ -78,84 +83,18 @@
         </dependency>
     </dependencies>
 
-    <build>
-        <resources>
-            <resource>
-                <directory>src/main/java</directory>
-                <excludes>
-                    <exclude>**/*.java</exclude>
-                </excludes>
-            </resource>
-            <resource>
-                <directory>config</directory>
-            </resource>
-        </resources>
-
-        <plugins>
-            <plugin>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
-                <configuration>
-                    <source>1.7</source>
-                    <target>1.7</target>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
     <profiles>
         <profile>
-            <id>java8-examples</id>
+            <id>java8</id>
+
+            <properties>
+                <java8.folder>src/main/java8</java8.folder>
+                <java.ver>1.8</java.ver>
+            </properties>
 
             <activation>
                 <jdk>[1.8,)</jdk>
             </activation>
-
-            <build>
-                <plugins>
-                    <plugin>
-                        <artifactId>maven-compiler-plugin</artifactId>
-                        <version>3.1</version>
-                        <configuration>
-                            <source>1.8</source>
-                            <target>1.8</target>
-                        </configuration>
-                    </plugin>
-
-                    <plugin>
-                        <groupId>org.codehaus.mojo</groupId>
-                        <artifactId>build-helper-maven-plugin</artifactId>
-                        <version>1.9.1</version>
-                        <executions>
-                            <execution>
-                                <id>add-sources</id>
-                                <phase>generate-sources</phase>
-                                <goals>
-                                    <goal>add-source</goal>
-                                </goals>
-                                <configuration>
-                                    <sources>
-                                        <source>src/main/java8</source>
-                                        <source>schema-import/src/main/java</source>
-                                    </sources>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>add-tests</id>
-                                <phase>generate-test-sources</phase>
-                                <goals>
-                                    <goal>add-test-source</goal>
-                                </goals>
-                                <configuration>
-                                    <sources>
-                                        <source>src/test/java8</source>
-                                    </sources>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
         </profile>
 
         <profile>
@@ -204,13 +143,17 @@
         </profile>
 
         <profile>
+            <!-- See README.txt for details -->
             <id>lgpl</id>
+
             <activation>
-                <file>
-                    <exists>config/hibernate/README.txt</exists>
-                </file>
+                <activeByDefault>false</activeByDefault>
             </activation>
 
+            <properties>
+                <lgpl.folder>src/main/java-lgpl</lgpl.folder>
+            </properties>
+
             <dependencies>
                 <dependency>
                     <groupId>org.apache.ignite</groupId>
@@ -226,4 +169,50 @@
             </dependencies>
         </profile>
     </profiles>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/java</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+            <resource>
+                <directory>config</directory>
+            </resource>
+        </resources>
+
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.1</version>
+                <configuration>
+                    <source>${java.ver}</source>
+                    <target>${java.ver}</target>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>add-sources</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>schema-import/src/main/java</source>
+                                <source>${lgpl.folder}</source>
+                                <source>${java8.folder}</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/b03ed4d7/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 7af772f..5129e7f 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -17,7 +17,8 @@
   limitations under the License.
 -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
@@ -101,55 +102,13 @@
         </dependency>
     </dependencies>
 
-    <build>
-        <resources>
-            <resource>
-                <directory>src/main/java</directory>
-                <excludes>
-                    <exclude>**/*.java</exclude>
-                </excludes>
-            </resource>
-            <resource>
-                <directory>config</directory>
-            </resource>
-        </resources>
-
-        <plugins>
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <version>1.9.1</version>
-                <executions>
-                    <execution>
-                        <id>add-sources</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>add-source</goal>
-                        </goals>
-                        <configuration>
-                            <sources>
-                                <source>schema-import/src/main/java</source>
-                                <source>src/main/java-lgpl</source>
-                            </sources>
-                        </configuration>
-                    </execution>
-
-                    <execution>
-                        <id>add-tests</id>
-                        <phase>generate-test-sources</phase>
-                        <goals>
-                            <goal>add-test-source</goal>
-                        </goals>
-                        <configuration>
-                            <sources>
-                                <source>src/test/java-lgpl</source>
-                            </sources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
+    <properties>
+        <!-- will be changed by profile activation. allows to combine profiles. -->
+        <lgpl.folder>src/main/java</lgpl.folder>
+        <java8.folder>src/main/java</java8.folder>
+        <lgpl.test.folder>src/test/java</lgpl.test.folder>
+        <java8.test.folder>src/test/java</java8.test.folder>
+    </properties>
 
     <profiles>
         <profile>
@@ -221,7 +180,12 @@
         </profile>
 
         <profile>
-            <id>java8-examples</id>
+            <id>java8</id>
+
+            <properties>
+                <java8.folder>src/main/java8</java8.folder>
+                <java8.test.folder>src/test/java8</java8.test.folder>
+            </properties>
 
             <activation>
                 <jdk>[1.8,)</jdk>
@@ -236,43 +200,68 @@
                             <target>1.8</target>
                         </configuration>
                     </plugin>
-
-                    <plugin>
-                        <groupId>org.codehaus.mojo</groupId>
-                        <artifactId>build-helper-maven-plugin</artifactId>
-                        <version>1.9.1</version>
-                        <executions>
-                            <execution>
-                                <id>add-sources</id>
-                                <phase>generate-sources</phase>
-                                <goals>
-                                    <goal>add-source</goal>
-                                </goals>
-                                <configuration>
-                                    <sources>
-                                        <source>src/main/java8</source>
-                                        <source>schema-import/src/main/java</source>
-                                        <source>src/main/java-lgpl</source>
-                                    </sources>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>add-tests</id>
-                                <phase>generate-test-sources</phase>
-                                <goals>
-                                    <goal>add-test-source</goal>
-                                </goals>
-                                <configuration>
-                                    <sources>
-                                        <source>src/test/java-lgpl</source>
-                                        <source>src/test/java8</source>
-                                    </sources>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
                 </plugins>
             </build>
         </profile>
+
+        <profile>
+            <id>lgpl</id>
+
+            <properties>
+                <lgpl.folder>src/main/java-lgpl</lgpl.folder>
+                <lgpl.test.folder>src/test/java-lgpl</lgpl.test.folder>
+            </properties>
+        </profile>
     </profiles>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/java</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+            <resource>
+                <directory>config</directory>
+            </resource>
+        </resources>
+
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>add-sources</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>schema-import/src/main/java</source>
+                                <source>${lgpl.folder}</source>
+                                <source>${java8.folder}</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+
+                    <execution>
+                        <id>add-tests</id>
+                        <phase>generate-test-sources</phase>
+                        <goals>
+                            <goal>add-test-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>${lgpl.test.folder}</source>
+                                <source>${java8.test.folder}</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>


Mime
View raw message