I have created a basic React App from https://www.tutorialspoint.com/reactjs/reactjs_jsx.htm here , I want to run this test code on Apache based server, I know that I need t
First, add a pom.xml and make it a maven project and then build it. It will create a War file for you in the target folder after that you can deploy it wherever you want.
pom.xml http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 it.megadix create-react-app-servlet 0.0.1-SNAPSHOT war
UTF-8
build
${project.artifactId}
org.apache.maven.plugins
maven-war-plugin
2.1.1
${npm.output.directory}
${basedir}/web.xml
org.codehaus.mojo
exec-maven-plugin
1.3.2
npm install (initialize)
exec
initialize
npm
install
npm install (clean)
exec
pre-clean
npm
install
npm run build (compile)
exec
compile
npm
run
build
true
${basedir}/npm
${NPM_CONFIG_PREFIX}/cache
${project.build.directory}/npmtmp
local
true
org.codehaus.mojo
exec-maven-plugin
http://localhost:8080/${project.artifactId}
/${project.artifactId}
prod
org.codehaus.mojo
exec-maven-plugin
http://my-awesome-production-host/${project.artifactId}
/${project.artifactId}
Note:- If you find a blank page after running your project then clear your cache or restart your IDE.