Jboss 7.x redeploy option - maven

I was looking for hard-deploy option in Jboss &.x but I believe that option is no longer supported in Jboss 7.x
what I found was this Jboss link containing latest plugins
.
I have decided to use Jboss-as:redeploy option.It seems to work perfectly for me- kind of replacement for hard-deploy.But when I check my Jboss/standalone/deployment folder the timestamp of war is not updated.But code changes are reflected in the application.below is the maven plugin code that I am using
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.5.Final</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>redeploy</goal>
</goals>
</execution>
</executions>
</plugin>`
Is there any bug in jboss plugin there ?Is it the right way to achieve my hard-deploy goal in Jboss 7.x

There seems to be no hard-deploy feature in the jboss 7.We have now used maven plugin to copy the new build to the deployment directory and Jboss will detect the change and deploy the new WAR.Below is the code for the same:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>copy-war-file</id>
<phase>install</phase>
<configuration>
<tasks>
<copy file="target/myapp.war" tofile="${env.JBOSS_HOME}\standalone\deployments\myapp.war" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>

Related

Plugin management in maven

Can you please suggest how to do plugin management in maven.
I have to call the below code
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<target>
<ant antfile="${basedir}/build/build.xml">
<target name="${ant.mode}" />
</ant>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
In some of the the submodule in a multi maven project module.
Can you suggest how to integrate this in only selective maven profiles?
Any Help will be appreciated .
Can some one suggest any solution for plugin management
You put the configuration into the parent into pluginManagement.
Either you specify the plugin (without configuration) in each module where you need it, or you use the skip parameter to activate/deactivate the plugin.

Why does maven-release-plugin uploads build information? And can it be removed?

When using the maven-release-plugin to release an artifact onto a repository, the entire pom is copied. This includes sections build and reporting.
I can understand that deployement information is propagated since dependencies of a project by the same creators are likely to be deployed on the same servers, but, for non-pom artifact, I don't understand the point of having the build information.
Is it possible to create a release stripped of this information?
Use the flatten-maven-plugin
https://www.mojohaus.org/flatten-maven-plugin/
I copied the relevant plugin configuration from the website above.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<!--<version>1.1.0</version>-->
<configuration>
</configuration>
<executions>
<!-- enable flattening -->
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<!-- ensure proper cleanup -->
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
I strips the POM from all unnecessary information.

maven javadoc generation issue of viewing on local tomcat server

I have managed to generate javadocs for my maven java project.
I use the following in
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</execution>
</executions>
</plugin>
I use the goal javadoc:javadoc when building.
Is there a way I can start my tomcat server and view the generated javadocs via a URL on my tomcat server? Something like localhost:8080/...
Thanks

maven tomcat7:run terminates automaticatlly in eclipse

Guys I know its very easy to run tomcat7 plugin in maven(in eclipse) but as I'm new to maven structure I can't figure it out that I was running maven build with "tomcat:run" and was working but I switched to maven plugin tomcat7 configured in pom.xml It starts it and stopped and gives build success msg. how change i make it keep listening?
Here my tomcate plugin settings
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<addContextWarDependencies>true</addContextWarDependencies>
<fork>true</fork>
<path>/</path>
<port>8080</port>
<httpsPort>8443</httpsPort>
<keystoreFile>C:/Users/Sohail Haider/.keystore</keystoreFile>
<keystorePass>apexsohail</keystorePass>
</configuration>
<executions>
<execution>
<id>start-tomcat</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run-war</goal>
</goals>
</execution>
<execution>
<id>stop-tomcat</id>
<phase>post-integration-test</phase>
<goals>
<goal>shutdown</goal>
</goals>
</execution>
</executions>
</plugin>
Take into account the default lifecycle in maven
So, what you are doing in the configuration is starting and stopping tomcat when you are building the project. I think that you have a webapp project and want to run tomcat so you have to remove executions tag from the configuration and just execute mvn tomcat7:run

How to Switch Maven osxappbundle-maven-plugin to use AppBundlerTask

I have a Java Swing project that I like to package for OSX by bundling up into App bundle.
I previously used a Maven osxappbundle-maven-plugin to achieve this. But these bundles do not work with Oracle's Java for Mac and I want to switch things to use Oracle's App Bundler.
It appears that Oracle's bundler is only available as an Ant Task and I'm not sure how to convert this into a Maven command.
My previous pom.xml used the following:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>osxappbundle-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<configuration>
<mainClass>${mainClass}</mainClass>
<dictionaryFile>${basedir}/src/main/resources/Info.plist</dictionaryFile>
<iconFile>${basedir}/src/main/resources/timelord.icns</iconFile>
<javaApplicationStub>${basedir}/src/main/resources/JavaApplicationStub</javaApplicationStub>
<jvmVersion>1.5+</jvmVersion>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
</plugin>
I think I need to do something like this - but not sure the format. How should this be formatted? Or is there a Maven plugin already built that uses Oracle's Bundler?
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<tasks>
<bundleapp outputdirectory="dist"
name="${AppName}"
displayname="${AppDisplayName}"
identifier="${mainClass}"
mainclassname="${mainClass}">
<runtime dir="${env.JAVA_HOME}" />
<classpath file="NOT SURE HOW TO MAKE THIS" />
</bundleapp>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
There is now a maven plugin for the Java 7/8 compatible oracle bundler

Resources