835 Star 2K Fork 1.1K

jflyfox / jfinal_cms

 / 详情

maven重复依赖问题。

Done
Opened this issue  
2017-10-02 23:58

我把源码下载下来后,运行“mvn tomcat:run”命令时报了一些编译警告,提示一些重复的依赖输入图片说明,希望作者能将这些小问题解决一下(虽然不影响运行,但是却不够严谨)。或者像spring的源码一样,使用一个jfinal-cms-dependencies的模块,声明各种依赖,其他模块使用时只需要声明groupId和artifactId即可,做到版本一处维护、统一管理。

Comments (2)

西门大官人 created 任务

该问题已经解决,以下是我修改后的pom文件(其中已经将jetty和tomcat的端口改成了8080,因为80端口比较特殊,部分电脑可能已经占用了)。

<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>com.jflyfox</groupId>
	<artifactId>jfinal_cms</artifactId>
	<packaging>war</packaging>
	<version>4.7.0</version>

	<properties>
		<!-- 文件拷贝时的编码 -->
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<!-- 编译时的编码 -->
		<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
	</properties>

	<dependencies>
		<dependency>
			<groupId>com.jfinal</groupId>
			<artifactId>jfinal</artifactId>
			<version>3.0</version>
		</dependency>
		<dependency>
			<groupId>com.jfinal</groupId>
			<artifactId>jfinal</artifactId>
			<version>3.0</version>
			<classifier>sources</classifier>
		</dependency>
		<dependency>
			<groupId>c3p0</groupId>
			<artifactId>c3p0</artifactId>
			<version>0.9.1.2</version>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>jsp-api</artifactId>
			<version>2.2</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.16</version>
		</dependency>
		<dependency>
			<groupId>commons-fileupload</groupId>
			<artifactId>commons-fileupload</artifactId>
			<version>1.3.1</version>
		</dependency>
		<dependency>
			<groupId>de.ruedigermoeller</groupId>
			<artifactId>fst</artifactId>
			<version>1.58</version>
			<exclusions>
				<exclusion>
					<groupId>org.javassist</groupId>
					<artifactId>javassist</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>net.sf.ehcache</groupId>
			<artifactId>ehcache</artifactId>
			<version>2.7.5</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>redis.clients</groupId>
			<artifactId>jedis</artifactId>
			<version>2.9.0</version>
		</dependency>		
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.4</version>
		</dependency>
		<dependency>
		    <groupId>com.alibaba</groupId>
		    <artifactId>fastjson</artifactId>
		    <version>1.2.28</version>
		</dependency>
		<dependency>
		    <groupId>com.ibeetl</groupId>
		    <artifactId>beetl</artifactId>
		    <version>2.7.11</version>
		</dependency>
		<dependency>
			<groupId>org.antlr</groupId>
			<artifactId>antlr4-runtime</artifactId>
			<version>4.2</version>
		</dependency>
		
		<dependency>
			<groupId>dom4j</groupId>
			<artifactId>dom4j</artifactId>
			<version>1.6.1</version>
			<exclusions>
				<exclusion>
					<groupId>xml-apis</groupId>
					<artifactId>xml-apis</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>com.jfinal</groupId>
			<artifactId>cos</artifactId>
			<version>26Dec2008</version>
		</dependency>
		<!-- aliyun oss -->
		<dependency>
			<groupId>com.aliyun.oss</groupId>
			<artifactId>aliyun-sdk-oss</artifactId>
			<version>2.0.6</version>
		</dependency>
		
		<!-- 数据库 -->
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.35</version>
		</dependency>
	</dependencies>

	<!-- 使用aliyun maven -->
	<repositories>
	  <repository>
	    <id>aliyun</id>
	    <name>aliyun</name>
	    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
	  </repository>
	</repositories>
  
	<build>
		<!-- 打包目录 -->
		<directory>target</directory>
		<!-- 打包名称 -->
		<finalName>${project.artifactId}</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
    			<artifactId>maven-compiler-plugin</artifactId>
    			<version>3.7.0</version>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
					<encoding>utf8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.6</version>
				<configuration>
					<failOnMissingWebXml>false</failOnMissingWebXml>
					<webResources>
						<resource>
							<targetPath>WEB-INF/classes</targetPath>
							<directory>src/main/resources</directory>
						</resource>
					</webResources>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.mortbay.jetty</groupId>
				<artifactId>jetty-maven-plugin</artifactId>
				<version>8.1.3.v20120416</version>
				<configuration>
					<stopPort>9966</stopPort>
					<stopKey>foo</stopKey>
					<scanIntervalSeconds>0</scanIntervalSeconds>
					<connectors>
						<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
							<port>8080</port>
							<maxIdleTime>60000</maxIdleTime>
						</connector>
					</connectors>
					<webAppConfig>
						<contextPath>/${project.artifactId}</contextPath>
					</webAppConfig>
					<classesDirectory>${basedir}/target/${project.artifactId}/classes</classesDirectory>
					<webAppSourceDirectory>${basedir}/target/${project.artifactId}</webAppSourceDirectory>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>tomcat-maven-plugin</artifactId>
				<version>1.1</version>
				<configuration>
					<port>8080</port>
					<path>/${project.artifactId}</path>
                    <warSourceDirectory>${basedir}/target/${project.artifactId}</warSourceDirectory>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>

感谢你的建议~只是一些warn不影响使用

Fly的狐狸 closed 任务

Sign in to comment

状态
Assignees
Milestones
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
Branches
Planed to start   -   Planed to end
-
Top level
Priority
参与者(2)
3244 flyfox 1621826689
Java
1
https://gitee.com/jflyfox/jfinal_cms.git
git@gitee.com:jflyfox/jfinal_cms.git
jflyfox
jfinal_cms
jfinal_cms

Search