Put Dependencies into a Lib Dir 57/39457/1
authorGuangrongFu <fu.guangrong@zte.com.cn>
Wed, 28 Mar 2018 06:37:08 +0000 (14:37 +0800)
committerGuangrongFu <fu.guangrong@zte.com.cn>
Wed, 28 Mar 2018 06:55:05 +0000 (14:55 +0800)
Change-Id: I073f90db334bb0e31cda979e48160a3daf0a82e6
Issue-ID: HOLMES-123
Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn>
engine-d-standalone/pom.xml
engine-d-standalone/src/main/assembly/bin/run.sh
engine-d/pom.xml

index 84a3970..bfa5ac6 100644 (file)
                             <overwrite>true</overwrite>
                         </configuration>
                     </execution>
+                    <execution>
+                        <id>copy-lib-${linux64id}</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${linux64outputdir}/lib</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${project.parent.basedir}/engine-d/target/lib</directory>
+                                    <filtering>false</filtering>
+                                </resource>
+                            </resources>
+                            <overwrite>true</overwrite>
+                        </configuration>
+                    </execution>
                     <execution>
                         <id>copy-resources-${win64id}</id>
                         <phase>process-resources</phase>
                             <overwrite>true</overwrite>
                         </configuration>
                     </execution>
+                    <execution>
+                        <id>copy-lib-${win64id}</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${win64outputdir}/lib</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${project.parent.basedir}/engine-d/target/lib</directory>
+                                    <filtering>false</filtering>
+                                </resource>
+                            </resources>
+                            <overwrite>true</overwrite>
+                        </configuration>
+                    </execution>
                     <execution>
                         <id>copy-dockerfile</id>
                         <phase>process-resources</phase>
index d3d5348..3f3c662 100644 (file)
@@ -30,7 +30,7 @@ port=8312
 #JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=$port,server=y,suspend=n"
 echo @JAVA_OPTS@ $JAVA_OPTS
 
-class_path="$main_path/:$main_path/holmes-engine-d.jar"
+class_path="$main_path/*:$main_path/lib/*:$main_path/holmes-engine-d.jar"
 echo @class_path@ $class_path
 
 sed -i "s/activemq.username=.*/activemq.username=activemq/" /home/activemq/apache-activemq-5.9.0/conf/credentials.properties
index 6bdc6be..967fa0b 100644 (file)
                     <archive>
                         <manifest>
                             <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                            <mainClass>org.onap.holmes.engine.EngineDActiveApp</mainClass>
+                            <classpathPrefix>lib/</classpathPrefix>
                         </manifest>
                     </archive>
                 </configuration>
             </plugin>
+
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-shade-plugin</artifactId>
-                <configuration>
-                    <createDependencyReducedPom>true</createDependencyReducedPom>
-                    <filters>
-                        <filter>
-                            <artifact>*:*</artifact>
-                            <excludes>
-                                <exclude>META-INF/*.SF</exclude>
-                                <exclude>META-INF/*.DSA</exclude>
-                                <exclude>META-INF/*.RSA</exclude>
-                            </excludes>
-                        </filter>
-                        <filter>
-                            <artifact>org.onap.holmes.dsa:dmaap-dsa</artifact>
-                            <excludes>
-                                <exclude>org/onap/holmes/common/**</exclude>
-                                <exclude>com/fasterxml/jackson/core/jackson-databind/**</exclude>
-                                <exclude>org/slf4j/**</exclude>
-                            </excludes>
-                        </filter>
-                    </filters>
-                </configuration>
+                <artifactId>maven-dependency-plugin</artifactId>
                 <executions>
                     <execution>
+                        <id>copy</id>
                         <phase>package</phase>
                         <goals>
-                            <goal>shade</goal>
+                            <goal>copy-dependencies</goal>
                         </goals>
                         <configuration>
-                            <transformers>
-                                <transformer
-                                    implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
-                                <transformer
-                                    implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
-                                    <mainClass>org.onap.holmes.engine.EngineDActiveApp
-                                    </mainClass>
-                                </transformer>
-                            </transformers>
+                            <outputDirectory>
+                                ${project.build.directory}/lib
+                            </outputDirectory>
                         </configuration>
                     </execution>
                 </executions>