How to convert maven project to web application project? - google-app-engine

I want to convert a maven project to a web application project, which should contain web.xml. I am using eclipse juno 4.2 with m2e (maven integration for eclipse) plugin software.
Any reply would be appreciated.

Install m2e-wtp
In your pom.xml, change or add the war packaging
right-click on project > Maven > Update project
m2e-wtp will create the src/main/webapp folder and add the Dynamic Web project Facet¤
manually add a WEB-INF folder under src/main/webapp
right-click on project > Java EE Tools > Generate Deployment Descriptor stub
It will create a web.xml under src/main/webapp/WEB-INF/
¤ By default, the web facet is set to 2.5. You should update it, if needed, under project properties > Project Facets BEFORE generating the web.xml

I assume your current project is a maven project which produces jar. Please confirm.
I have not come across any utility which can convert a jar project to a war project.
You have following two options -
Simple open the pom.xml and change jar to war. Create folder webapp under src/main and create a web.xml
Create a new web app project via maven command line choosing webapp archetype or via eclipse choosing maven webapp achetype. Define dependency to your jar project.
If you can provide more information based on my suggestion then probably I can help.

Related

Build several projects from one repository with Azure DevOps

We have one Java/Spring Boot/React project hosted on GitLab. After initial development we decided to move to Azure DevOps. Project structure hosted on the GitLab and in local folder structure is simple:
-- Parent project (parent folder)
------- First Spring Boot Project (built with Maven, produces JAR1)
------- Second Spring Boot Project (built with Maven, uses JAR1 as dependency, produces JAR2)
------- React project (built with NPM, produces static pages)
I need to setup separate build process for React and for Spring 1 and 2 projects.
In Azure DevOps there is selector for build from specific branch but I don't see how can I set pipelines to build project from specific folder?
When you use Maven task to build your Spring Boot Project, you need to specify the path to your pom.xml file by changing the value of Maven POM file field. The file path value should be relative to the root of the repository, such as IdentityService/pom.xml or $(system.defaultWorkingDirectory)/IdentityService/pom.xml.
Here is the document about Maven task.
When you use npm task to build your React project, you can set the working folder that contains package.json. Please select the folder instead of the file when you set the working folder.
Here is the document about npm task.
In addition, you may also need to set path filters in Continuous integration (CI) triggers. Here is the document about CI Triggers.
You have path filter:
# specific path build
trigger:
branches:
include:
- master
- releases/*
paths:
include:
- docs/*
exclude:
- docs/README.md
Please check documentation here

How to deploy DocDokuPLM project on JBoss Wildfly10?

I have cloned the docdoku-plm from this repository https://github.com/docdoku/docdoku-plm/tree/dev
I build this project but i don't know what i have to deploy in my server , i checked in pom.xml and they have given packaging as pom
After i build the project no target file is created.
I want help how can i deploy this project in my wildfly 10 server.This is the structure of the project and after bulid there is no target file created
First of all when you build your project,one EAR file is generated in eplm module, you need to deploy that EAR file in wildfly.
After this follow this link https://github.com/docdoku/docdoku-plm/wiki/Installation-Guide for configuration according to your server.
In docdoku-plm if you are using eplm project and deploying in glassfish,by default it will take EclipseLink as JPA framework and in WIldfly it is Hibernate So you have to add dependency in pom.xml or change hibernate module to eclipselink.

tomcat8 Maven plugin

Is anyone having idea on status of tomcat8 Maven Plugin. Is it ready for use or not ? I can locate the repository for it here but could not find this plugin on apache site. I tried using it with same configuration as that of tomcat7-maven-plugin but it does not start my application.
Go to following link
https://mvnrepository.com/artifact/org.apache.tomcat.maven/tomcat8-maven-plugin/3.0-r1756463
copy paste the dependency tag
<dependency>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat8-maven-plugin</artifactId>
<version>3.0-r1756463</version>
But still if your pom file shows can't locate repository
click on the download link in above url and download jar file and past it in <your-home-directory>/.m2/repository/org/apache/tomcat/maven/tomcat8-maven-plugin/3.0-r1756463
In your IDE update maven project
tomcat maven plugin is only available for tomcat7, you can try spring boot which has an embedded tomcat8, it also provides other containers, like jetty

Google App Engine: how to generate discovery doc for iOS (gradle build)?

I am using Android Studio to develop my ( GAE + Cloud Endpoints ) server, and I need to generate a discovery doc for iOS.
Google doc: Generating Client Libraries shows two ways to generate discovery doc for iOS:
using Maven
My backend project is developed in Studio and build by gradle, so I can not take this option.
using endpoints.sh (Change directory to the parent directory of your project's /war directory.)
I do not have the /war directory in my gradle build structure.
How do I generate client-library for iOS ? Can any one help with this?
Thanks to #Opal!
after running gradle war there is a generated directory called backend/build/discovery-docs which contains:
apiname-v1-rest.discovery
apiname-v1-rpc.discovery
so I got discovery doc for iOS, there is no need to run :
using endpoints.sh (Change directory to the parent directory of your project's /war directory.)

Importing google app engine project from eclipse into intellij

I'm trying out intellij to see what it is like to develop/maintain google app engine projects. I've used the GAE plugin for eclipse for a couple of years and it usually worked flawlessly for me but I've heard a lot about intellij recently so I wanted to see what I was missing.
I've read many sites that describe step-by-step how to create new GAE projects in intellij but none that describe how to do so for existing projects. I'm struggling with I imagine is some intellij 101 topics. I have a few questions that I'm bundling together here:
I added the Web/GAE facet to the project and specified the appropriate GAE SDK directory and appengine account info. What's the right way to associate the right SDK jars with my project?
IntelliJ recognized my maven imports and added them to my External Libraries, things like apache commons, slf4j, etc. How do these jars make their way into the (exploded war) artifact I created for the project? Are they automatically copied there after a successful compile?
I'm using JDO so I downloaded the DataNucleus plugin. How do I wire it up so it enhances my classes?
Thanks in advance.
File - Project Structure - Modules - AppEngine: at the right side is "Path to AppEngine SDK install directory". Click button right to it to select dir via file selector. This is the right way - here Intellij will use all the needed jars in your project, no need to add GAE jars by hand .
File - Project Structure - Artifacts: you should have a war artifact here. Create one if it's not there (+). Jars used in the project should be in "Available Elements" pane. You can add jars (if not added automatically) by drag-n-dropping them between panes. Yes, jars will be copied into war if they are in the left pane showing the contents of the package.
File - Project Structure - Modules - AppEngine: check the "Run enhancer for the following classes.." and select your classes/packages.

Resources