unable to acess the admin console of Wildfly when using wildfly-maven-plugin - maven

I am new to Wildfly (8.0.0.Final) and maven. I used the standalone script to start WildFly server and I've added a management user called admin to be able to acess the admin interface. But when I start the wildfly server using wildfly maven plugin like this :
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.0.0.Final</version>
<configuration>
/configuration>
</plugin>
and trying to access the admin console I see a prompt message ""Your WildFly Application Server is running. However you have not yet added any users to be able to access the admin console.""
Any clue??? Thanks

First of all why don't you use the latest versions of a) wildlfy server: 8.2.0 and b) wildlfy maven plugin: 1.0.2.Final
Now if you want to use maven to both start the server and deploy your app then you need to tell to maven where your server is located by using -Djboss-as.home property (info taken from http://blog.arungupta.me/wildfly-maven-plugin-tech-tip-9/) or set the <jbossHome/> configuration tag.
If the property -Djboss-as.home or <jbossHome/> is not specified WildFly is downloaded and started and the application is deployed to it. You will find at the target directory of your project the newly downloaded server, in my case: mavenWildfyTest\target\wildfly-run\wildfly-8.2.0.Final
Check into the bin folder and you will find add-user.bat. If you run it you will add a user and you will be able to log in to the management console of the downloaded wildlfy server.
However, I believe, this is not what you want but instead you want to use maven plugin to deploy apps in your own Wildfly server.
In that case you have two options:
start the server beforehand by using the standalone script (bat or sh) and then use mvn wildfly:deploy or
use mvn wildfly:run with -Djboss-as.home defined, in my case: mvn wildfly:run
-Djboss-as.home=K:\app_servers\wildfly-8.1.0.Final

Related

Deploying AEM projects using Maven

We are new to Adobe and going to start working with it. Our Build Tool is maven, CI tool- Jenkins. As we are using Maven as a build tool. How to deploy our artifacts to jetty web server?
In short, Can we deploy artifacts of adobe project using maven? or do we need to have plugins for jenkins to deploy artifacts to different environment. I have came across
Maven-jetty and cargo plugin for deployments using maven to jetty webserver.
If you want to deploy your project with Maven I suggest that you use the content-package-maven-plugin. You can read more about the details in Adobes official documentation. The basic principal is the following:
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<version>0.5.24</version>
<configuration>
<userId>admin</userId>
<password>admin</password>
<targetURL>http://localhost:4502/crx/packmgr/service.jsp</targetURL>
</configuration>
</plugin>
This is a simple example that would deploy to a default AEM installation on your local machine (or same machine as mvn runs).
If you are running your build on Jenkins you might want to consider not using Maven to deploy your artifacts. Usually, you have multiple AEM instances running to which you want to deploy your content packages: "author" and "publish".
For the builds running on Jenkins I would suggest deploying your artifacts using curl. I wrote an answer about uploading and installing content packages using curl on Stack Overflow: How to install large (content) packages in AEM.
I would strongly suggest you to use the Aem maven archetype to create your project. It will come with the default settings, POM entries so that you can change your configuration to deploy it to the required environments.
Here is the link -
https://github.com/Adobe-Marketing-Cloud/aem-project-archetype

Maven JBOSS application deployment

I followed this tutorial http://www.mastertheboss.com/jboss-maven/jboss-maven-example-building-a-java-ee-6-application/ in order to have a simple web application to better understand Java EE and JBOSS. I set up the example project (by archetype) and compiled it.
However, I am stuck after running mvn compile. I want to deploy my application as a war file to my JBOSS webroot directory (in my case /usr/share/jboss-as/standalone/deployments/).
I think mvn package and mvn install must be executed. Where can I specify that I want a war file and that it should be copied to my deployment location on JBOSS?
Obviously, I can use the jboss maven plugin http://docs.jboss.org/jbossas/7/plugins/maven/latest/, which is addressed via console
jboss-as:deploy
Configuration is read from the POM file.

Weblogic Maven Plugin Deployment Issue

I'm using eclipse Kepler, Weblogic 10.3.5 and Maven 3.0.5 with the Weblogic-Maven-Plugin. When I deploy my application using eclipse Run As...Run On Server, this is what I get:
When I deploy this way, you see the application on the Weblogic Server and I'm able to reach my application through my localhost link.
When I use the Weblogic-Maven-Plugin, this is what I get:
You see the application has been placed under the adminServer and I get an error when I try to reach the application through my localhost link (Yes, I even ran the start-app command).
I have few questions:
Why is it that when I use the weblogic-maven-plugin, it deploys under the adminServer?
Is there a way to have the weblogic-maven-plugin deploy in a similar fashion as the Run As option in eclipse?
Why can I not reach the application with my localhost link after deploying with the plugin?
Any help is greatly appreciated.
I face this problem some weeks ago but in another environment Jdeveloper 12c with Maven and OJMake and OJDeploy.
The deployment is the last step on your way to run our application on WLS(WebLogic Server)
How do i solve the issue?
I create an Maven Ear projet
I create also Maven War project
I add the war project in the ear project also dependency and later also web_module
My deploy(to WLS) Configuration is in the pom from Ear project.
I you use run as from Eclipse or Jdeveloper there is a complex mechanism which do the work for us. If we want maven to do the job for us, then we must tell him what to do. We must also know what type of archive file we suppose to send/deploy to WLS

Maven jetty or tomcat plugin with hot deploy option including dependencies

I have a maven project with root module called "sample" and two child modules in their own directories "sample-services" and "sample-web". "sample-web" is a war module which depends on "sample-services"
I want to be able to run my server from maven (it could be jetty, tomcat, or any lightweight server) and debug my code without using eclipse or intellij idea j2ee integration (for example in Intellij Idea community edition or other IDE that supports remote debugger) and just by adding a remote debugger.
I could start my app with "jetty:run" and attach the debugger but the problem is that when I change my code in "sample-services" it doesn't pick it up unless I run "mvn install" on that module separately and restart the server.
Is there a better way to be able to debug the app and have the server redeploy the code changes without having to restart the server?
I know eclipse can do this for a maven project. It will detect the changes in dependent project and upload them to the server.
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.0.3.v20130506</version>
</plugin>
EDIT:
I ended up using tomcat maven plugin for now:
org.apache.tomcat.maven
tomcat7-maven-plugin
2.1
/
true
in your pom.xml and run in the command line: mvn tomcat7:run
Downside is that this will reload the whole app upon each change instead of hot-deploy.
So now I am looking for a hot deploy alternative.

How do I deploy a maven created webapp to tomcat

So I was following http://www.mkyong.com/jsf2/jsf-2-0-hello-world-example/ for a simple tutorial on how to use maven and jsf. I created a maven project by running mvn archetype:generate -Dfilter=org.apache:maven-archetype-webapp in my command prompt. Then I continued with the tutorial, I wound up creating all necessary files, but then when I got to the end, I realized I did have a server created. So I created one real quick, but when it came to the point of adding files to the server (from the add or remove dialog box), no projects or files showed up. I am not on my computer where the project is located so I can't copy/paste the .pom file in, but it looks practically exactly like the pom in the tutorial (only difference is groupId, artifact, ect.) No additional plugins, dependencies, or configs.
Do you want to deploy the webapp within Eclipse to Tomcat? Or as some sort of automatic/continuous deployment?
Within Eclipse you often need to add the Dynamic Web project and JSF facets to your project so Eclipse recognizes the project as deployment capable. If you are using m2eclipse make sure to install the m2eclipse wtp add on so this is done automatically.
If you want to add auto-deployment to the pom.xml I recommend using the maven cargo plugin: http://cargo.codehaus.org/Maven2+plugin - it supports the major containers.
For tomcat you need to modify the tomcat-users.xml to allow auto-deployment and leave the tomcat-manager application in place. If you have startet tomcat and pointing your browser to http://localhost:8080/manager/html/list it should either tell you to login or what to add to that file.
The configured user is then used in the configuration to deploy the war file via the tomcat-manager using the mvn cargo:deploy goal. The configuration has to be added to the pom.xml using war as packaging, not to the parent-pom.xml

Resources