Properties and plugin change of examples module for legal files (#4361)

Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
diff --git a/examples/pom.xml b/examples/pom.xml
index b93deed..928238e 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 
-    Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
+    Copyright (c) 2011, 2020 Oracle and/or its affiliates. All rights reserved.
 
     This program and the accompanying materials are made available under the
     terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -181,6 +181,23 @@
                     </executions>
                 </plugin>
                 <plugin>
+                    <groupId>org.commonjava.maven.plugins</groupId>
+                    <artifactId>directory-maven-plugin</artifactId>
+                    <version>0.3.1</version>
+                    <executions>
+                        <execution>
+                            <id>directories</id>
+                            <goals>
+                                <goal>highest-basedir</goal>
+                            </goals>
+                            <phase>initialize</phase>
+                            <configuration>
+                                <property>legal.source.folder</property>
+                            </configuration>
+                        </execution>
+                    </executions>
+                </plugin>
+                <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-resources-plugin</artifactId>
                     <version>2.6</version>
@@ -263,8 +280,4 @@
         </resources>
     </build>
 
-    <properties>
-        <legal.source.folder>${maven.multiModuleProjectDirectory}/examples</legal.source.folder>
-    </properties>
-
 </project>