Intellij Idea maven hello world
来源:互联网 发布:思快奇软件下载 编辑:程序博客网 时间:2024/05/16 11:49
首先看下目录结构
src和pom.xml
pom.xml
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>hello</groupId> <artifactId>hello</artifactId> <version>5.0-SNAPSHOT</version> <packaging>war</packaging> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.2.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-freemarker</artifactId> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.2.1</version> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.2</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-feign</artifactId> <version>1.2.2.RELEASE</version> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-server</artifactId> <version>1.18</version> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-grizzly2</artifactId> <version>1.18</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.8</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.5.0</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.9</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot</artifactId> <version>1.5.3.RELEASE</version> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-ftp</artifactId> <version>2.13.2</version> </dependency> </dependencies> <profiles> <profile> <id>development</id> <properties> <envs>development</envs> </properties> </profile> <profile> <id>localhost</id> <properties> <envs>localhost</envs> </properties> </profile> <profile> <id>product</id> <properties> <envs>product</envs> </properties> </profile> <profile> <id>test</id> <properties> <envs>test</envs> </properties> </profile> </profiles> <build> <finalName>hello</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> <encoding>UTF8</encoding> </configuration> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> <encoding>UTF-8</encoding> </configuration> </plugin> </plugins> <filters> <filter>src/main/filters/filter-${envs}.properties</filter> </filters> <resources> <resource> <directory>src/main/filters/resources/${envs}</directory> </resource> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> </build></project>
public class Application extends SpringBootServletInitializer { public static void main(String[] args) throws Exception { SpringApplication.run(Application.class, args); }}
用idea,选择file-->open这个目录的文件夹,然后以下操作,
右边+号,添加项目,,添加选择pom.xml,这样
加jdk
加下tomcat
右边maven中
filter选中一个环境,比如test,然后
先clean 再compile
最后点击启动,会出现启动成功页面:
你好!这是我的首页!
阅读全文
1 0
- Intellij Idea maven hello world
- IntelliJ IDEA 创建 hello world Java web Maven项目
- IntelliJ Idea搭建Groovy环境Hello World
- 使用Intellij IDEA编写Spring Hello World
- aop aspectj [intellij idea配置] [hello world]
- IntelliJ IDEA 创建 hello world Java web Maven项目从头到尾都有图有真相2017版本
- IntelliJ IDEA 创建 hello world Java web Maven项目从头到尾都有图有真相2017版本
- IntelliJ IDEA 2017版 创建 hello world Java web Maven项目
- IntelliJ IDEA 创建 hello world Java web Maven项目遇到的问题
- IntelliJ IDEA 创建 hello world Java web Maven项目从头到尾都有图有真相2017版本
- IntelliJ IDEA 创建 hello world Java web Maven项目从头到尾都有图有真相2017版本
- Java springmvc web项目,基于maven的hello world入门级项目使用IntelliJ IDEA 2017版本
- Scala从零开始:使用Intellij IDEA写hello world
- Scala从零开始:使用Intellij IDEA写hello world
- 【转】Scala从零开始:使用Intellij IDEA写hello world
- intellij idea Spring MVC 学习之Hello World
- spring boot 入门(一):IntelliJ IDEA 实现hello world
- Intellij Idea系列之简单Hello World(2)
- VUE中的无限循环
- 23种设计模式(20):外观模式(2)
- Excel2007表格中如何将一些表示概率的数字转换为百分数
- 修改时,判断单选按钮选中的哪一个。两种办法
- 大数据时代结构化存储云HBase技术架构及最佳实践
- Intellij Idea maven hello world
- RYU控制器代码解析-简单交换机
- port
- js基础-this关键字 ★★★
- ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
- Linux core 文件介绍
- OpenCV non-free functionality (SURF) not built in 解决方法
- C++ sizeof
- windows 临界区的实现原理