Skip to content

Instantly share code, notes, and snippets.

@pubudu94
Created June 24, 2018 14:29
Show Gist options
  • Save pubudu94/9fa7ed090205608ea870282db4c280b1 to your computer and use it in GitHub Desktop.
Save pubudu94/9fa7ed090205608ea870282db4c280b1 to your computer and use it in GitHub Desktop.
<build>
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>generate-rebel-xml</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
<executions>
<execution>
<id>default-install</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>
${domain.dir}/lib/mbeantypes
</outputDirectory>
<resources>
<resource>
<directory>
${project.build.directory}
</directory>
<includes>
<include>
${project.build.finalName}.jar
</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.3.1</version>
<executions>
<execution>
<id>default-install</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${generated.sources.dir}</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
<dependencies>
<dependency>
<groupId>weblogic</groupId>
<artifactId>weblogic</artifactId>
<version>${weblogic.version}</version>
<scope>system</scope>
<systemPath>
${oracle.home}/12.1.3.0/wlserver/server/lib/weblogic.jar
</systemPath>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-mbean</id>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<java fork="true" classname="weblogic.management.commo.WebLogicMBeanMaker"
classpathref="maven.plugin.classpath">
<jvmarg
value="-DMDF=${project.build.outputDirectory}/CustomAuthentication.xml"/>
<jvmarg
value="-Dfiles=${project.build.outputDirectory}"/>
<jvmarg value="-DcreateStubs=true"/>
<jvmarg value="-Dverbose=true"/>
</java>
</tasks>
</configuration>
</execution>
<execution>
<id>generate-jar</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<java fork="true"
classname="weblogic.management.commo.WebLogicMBeanMaker"
classpathref="maven.plugin.classpath">
<jvmarg value="-DMJF=${jar.file}"/>
<jvmarg value="-Dfiles=${project.build.outputDirectory}"/>
<jvmarg value="-DcreateStubs=true"/>
<jvmarg value="-DpreserveStubs=true"/>
<jvmarg value="-Dverbose=true"/>
<arg value="-preserveStubs"/>
</java>
<move
todir="${generated.sources.dir}/${package.dir}"
file="${project.build.outputDirectory}/CustomAuthenticationImpl.java"/>
<move todir="${generated.sources.dir}">
<fileset
dir="${project.build.outputDirectory}">
<include name="**/*.java"/>
</fileset>
</move>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment