今天刷知乎的时候刷到这么一句话
我觉得还是蛮有趣的,形容的也比较到位,正好最近新建maven项目进行了thrift数据的传输,在此做一个记录
首先idea整合了maven,不需要单独下载
新建一个Project,选择Maven,设置好sdk后(一般默认),勾选create from archetype, 选择图中选择的 maven-archetype-webapp
点击next,设置groupid和artifactid(这个有什么用暂时我还不知道)
单击next,这一步可以创建或者导入仓库,下载必要的jar包,我之前创建过maven项目,所以我直接覆盖仓库即可
单击next,最后一步,创建工程名字
进入maven项目,导入我们之前保存的jar包:
<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>FIS_SYSTEM</groupId> <artifactId>fis_system</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>fis_system Maven Webapp</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>org.apache.thrift</groupId> <artifactId>libthrift</artifactId> <version>0.9.3</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.7.5</version> </dependency> <dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.4</version> <classifier>jdk15</classifier> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.12</version> </dependency> </dependencies> <build> <finalName>fis_system</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.5</version> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin> </plugins> </build> </project>
以上完成后,开始配置tomcat
然后就是常见的tomcat配置,基本上没什么好修改的,底部有一个提示:no artifacts marked for deployment,单击一旁的fix,选择带有exploded的选项
启动tomcat,弹出熟悉的hello world页面,大功告成:
时间: 2024-10-06 23:42:40