Preparation
- Intellij Idea ULTIMATE (mine is 17.02)
- Plugins
- Lombok
- Save Actions
Build project
After download hue-scheduler
with git clone. Run "mvn package" to build the project.
Open Idea
Need to pre set some environment variables, so we can write script according to eclipse.sh
.
I share mine.
#!/bin/bash
SET_ENV_DIR=$WORK_SPACE_DIR/set-env.sh
if [ -f $SET_ENV_DIR ]
then
source $SET_ENV_DIR
`/opt/idea-IU-172.3317.76/bin/idea.sh` >& /dev/null &
else
echo "no source file in ${WORK_SPACE_DIR}"
fi
Import projects
- Select
New
->Project from Existing Sources
-> Selecthue-scheduler
- Select
Import project from external model
->Maven
-> PressNext
- Enable check box
Search for projects recursively
, and enable check boxImport Maven projects automatically
-> PressNext
- Press
Next
utilFinish
Config server
- Add Tomcat application server
- Open Settings dialog: From menu bar,
File
->Settings...
- Open Application Servers setting:
Build, Execution, Deployment
->Application Servers
- Add Tomcat: Click the top-leftmost
+
symbel -> Select your Tomcat install path -> ClickOK
- Apply settings: Click
Apply
-> ClickOK
- Open Settings dialog: From menu bar,
- Create Tomcat server
- Open Run Configurations: From menu bar,
Run
->Edit configurations
- Add local Tomcat server: Click the top-leftmost
+
symbel ->Tomcat Server
->Local
-> A local Tomcat server created
- Open Run Configurations: From menu bar,
- Config Tomcat
- VM options: Select a local Tomcat server -> config VM options from
Server
tag. - Deployment setting: Select
Deployment
tag -> click the+
symbel ->Artifact
-> Select thehue-scheduler-front:war exploded
artifact to deploy - Config application context: input
/hue-scheduler-front
- Apply configurations: Click
Apply
-> ClickOK
- VM options: Select a local Tomcat server -> config VM options from
- Config Project Structure
- Wipe out some incorrect content root: Open
Project Structure
-> Clickhue-scheduler-front
-> SelectSources
tag -> Wipe out WrongContent Root
- Wipe out some unnecessary modules: Open
Project Structure
-> Deletehue-scheduler-front-aggregator
andhue-scheduler-client-lib
. (Actually, what we need ishue-scheduler-client-lib-server-side
that will be added next). - Now, You can boot Server for test.
- Wipe out some incorrect content root: Open
Config class path and deployment assembly
- Import project
hue-scheduler-client-lib
, it will be shown ashue-scheduler-client-lib-aggregator
- Select module
hue-scheduler-front
, and open module setting dialog. - Select
Dependencies
tag, removehue-scheduler-client-lib-server-side
library file, and add importedhue-scheduler-client-lib-server-side
module - Select
Artifacts
from left panel, and selecthue-scheduler-front:war exploded
, and selectOutput Layout
- Select
WEB-INF
->lib
-> Removehue-scheduler-client-lib
library file - Select
WEB-INF
->classes
->+
->Module Output
-> Choosehue-scheduler-client-lib-server- side
- Select
- Apply configurations: Click
Apply
-> ClickOK
网友评论