All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.maven.io.github.scouter-project.scouter-agent-java.pom.xml Maven / Gradle / Ivy

There is a newer version: 2.20.0
Show newest version
<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>
        <groupId>io.github.scouter-project</groupId>
        <artifactId>scouter-parent</artifactId>
        <version>v1.8.0</version>
    </parent>

    <artifactId>scouter-agent-java</artifactId>
    <packaging>jar</packaging>
    <name>scouter.agent.java</name>

    <properties>
        <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
        <build.datetime>${maven.build.timestamp} GMT</build.datetime>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <scouter.http.jar>scouter.http.jar</scouter.http.jar>
        <scouter.httpclient.jar>scouter.httpclient.jar</scouter.httpclient.jar>
        <scouter.tools.jar>scouter.tools.jar</scouter.tools.jar>

        <provided.tools.jar>${project.basedir}/lib/provided/tools.jar</provided.tools.jar>
        <final.jar.name>${project.build.directory}/${project.build.finalName}.jar</final.jar.name>
        <final.jar.name.xtra>${project.build.directory}/xtra-${project.build.finalName}.jar</final.jar.name.xtra>
        <final.jar.name.shade>${project.build.directory}/shade-${project.build.finalName}.jar</final.jar.name.shade>
        <scouter.agent.file.name>scouter.agent.jar</scouter.agent.file.name>
        <scouter.agent.min.file.name>scouter.agent.min.jar</scouter.agent.min.file.name>

        <provided.tools.jar>${project.basedir}/lib/provided/tools.jar</provided.tools.jar>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.github.scouter-project</groupId>
            <artifactId>scouter-common</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- local lib -->
        <dependency>
            <groupId>com.github.scouter-project</groupId>
            <artifactId>byte-buddy-nodep-scouter-repack</artifactId>
            <version>1.7.1.RC1</version>
        </dependency>
        <dependency>
            <groupId>jdk.tools</groupId>
            <artifactId>jdk.tools</artifactId>
            <version>tools-0.0.0</version>
            <scope>system</scope>
            <systemPath>${provided.tools.jar}</systemPath>
        </dependency>

        <!-- provided -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.3.6</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
            <version>4.3.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.netflix.ribbon</groupId>
            <artifactId>ribbon-loadbalancer</artifactId>
            <version>2.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.reactivex</groupId>
            <artifactId>rxnetty</artifactId>
            <version>0.4.6</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>4.3.7.RELEASE</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>4.3.7.RELEASE</version>
            <scope>provided</scope>
        </dependency>
        <!-- test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>2.3.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <compilerVersion>1.6</compilerVersion>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Premain-Class>scouter.agent.JavaAgent</Premain-Class>
                            <Agent-Class>scouter.agent.JavaAgent</Agent-Class>
                            <Can-Redefine-Classes>true</Can-Redefine-Classes>
                            <Can-Retransform-Classes>true</Can-Retransform-Classes>
                            <Boot-Class-Path>${project.build.finalName}</Boot-Class-Path>
                        </manifestEntries>
                    </archive>
                    <excludes>
                        <exclude>**/scouter/xtra/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.4.3</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>false</shadedArtifactAttached>
                            <createDependencyReducedPom>true</createDependencyReducedPom>
                            <createSourcesJar>true</createSourcesJar>
                            <shadeSourcesContent>true</shadeSourcesContent>
                            <filters>
                                <filter>
                                    <artifact>io.github.scouter-project:scouter-common</artifact>
                                    <excludes>
                                        <exclude>scouter/v.properties</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <id>make-ext-jar</id>
                        <phase>package</phase>
                        <configuration>
                            <target>
                                <jar destfile="${project.build.directory}/${scouter.http.jar}">
                                    <fileset dir="${project.build.outputDirectory}">
                                        <include name="scouter/xtra/http/*.class" />
                                    </fileset>
                                </jar>
                                <jar destfile="${project.build.directory}/${scouter.httpclient.jar}">
                                    <fileset dir="${project.build.outputDirectory}">
                                        <include name="scouter/xtra/httpclient/*.class" />
                                    </fileset>
                                </jar>
                                <jar destfile="${project.build.directory}/${scouter.tools.jar}">
                                    <fileset dir="${project.build.outputDirectory}">
                                        <include name="scouter/xtra/tools/*.class" />
                                    </fileset>
                                </jar>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>add-to-uber-jar</id>
                        <phase>package</phase>
                        <configuration>
                            <target>
                                <echo message="final.jar.name = ${final.jar.name}" />
                                <echo message="final.jar.name.xtra = ${final.jar.name.xtra}" />

                                <jar destfile="${final.jar.name.xtra}">
                                    <fileset dir="${project.build.directory}">
                                        <include name="${scouter.http.jar}" />
                                        <include name="${scouter.httpclient.jar}" />
                                        <include name="${scouter.tools.jar}" />
                                    </fileset>
                                    <zipfileset src="${final.jar.name}" />

                                    <manifest>
                                        <attribute name="Premain-Class" value="scouter.agent.JavaAgent" />
                                        <attribute name="Agent-Class" value="scouter.agent.JavaAgent" />
                                        <attribute name="Can-Redefine-Classes" value="true" />
                                        <attribute name="Can-Retransform-Classes" value="true" />
                                        <attribute name="Boot-Class-Path" value="${project.build.finalName}.jar" />
                                    </manifest>
                                </jar>

                                <copy file="${final.jar.name}" tofile="${final.jar.name.shade}" overwrite="true" verbose="true" />
                                <copy file="${final.jar.name.xtra}" tofile="${final.jar.name}" overwrite="true" verbose="true" />
                                <delete file="${project.build.directory}/${scouter.http.jar}" />
                                <delete file="${project.build.directory}/${scouter.httpclient.jar}" />
                                <delete file="${project.build.directory}/${scouter.tools.jar}" />

                                <!-- for constant name file -->
                                <jar destfile="${project.build.directory}/${scouter.agent.file.name}">
                                    <zipfileset src="${final.jar.name}" />
                                    <manifest>
                                        <attribute name="Premain-Class" value="scouter.agent.JavaAgent" />
                                        <attribute name="Agent-Class" value="scouter.agent.JavaAgent" />
                                        <attribute name="Can-Redefine-Classes" value="true" />
                                        <attribute name="Can-Retransform-Classes" value="true" />
                                        <attribute name="Boot-Class-Path" value="${scouter.agent.file.name}" />
                                    </manifest>
                                </jar>

                                <!-- for min file -->
                                <jar destfile="${project.build.directory}/${scouter.agent.min.file.name}">
                                    <zipfileset src="${final.jar.name}" excludes="scouter/repack/net/bytebuddy/**/*" />
                                    <manifest>
                                        <attribute name="Premain-Class" value="scouter.agent.JavaAgent" />
                                        <attribute name="Agent-Class" value="scouter.agent.JavaAgent" />
                                        <attribute name="Can-Redefine-Classes" value="true" />
                                        <attribute name="Can-Retransform-Classes" value="true" />
                                        <attribute name="Boot-Class-Path" value="${scouter.agent.file.name}" />
                                    </manifest>
                                </jar>

                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <configuration>
                            <target>
                                <tar destfile="${project.build.directory}/${scouter.agent.java.assembly.name}.tar">
                                    <tarfileset dir="${project.basedir}">
                                        <include name="conf/**/*" />
                                    </tarfileset>
                                    <tarfileset dir="${project.basedir}">
                                        <include name="plugin/**/*" />
                                    </tarfileset>
                                    <tarfileset dir="${project.build.directory}">
                                        <include name="${project.build.finalName}.jar" />
                                        <include name="${scouter.agent.file.name}" />
                                        <include name="${scouter.agent.min.file.name}" />
                                    </tarfileset>
                                </tar>
                                <!-- copy for preparing whole packaging -->
                                <mkdir dir="${scouter.whole.packaging.prepare.dir}" />
                                <copy file="${project.build.directory}/${scouter.agent.java.assembly.name}.tar" todir="${scouter.whole.packaging.prepare.dir}" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy