maven+springMvc+velocity

2019-03-27 01:08|来源: 网路

在主项目目录下面比如:ZZ91文件夹下面 使用mvn命令创建一个web项目,common service persist三个java项目.

common用来存放domain实体类

service层用来存放service 和serviceImpl业务逻辑的实现

persist曾用来存放dao层持久层,和对应实体类的xml映射文件.

然后在该文件夹下面编写父类的pom文件

<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.ast1949</groupId>
    <artifactId>ast1949-parent</artifactId>
    <name>ast1949-parent</name>
    <packaging>pom</packaging>
    <version>1.0.0-SNAPSHOT</version>

    <properties>
        <java.source.version>1.6</java.source.version>
        <java.target.version>1.6</java.target.version>
        <encoding>UTF-8</encoding>
        <project.version>1.0.0-SNAPSHOT</project.version>
        <project.prefix>ast</project.prefix>
        <!--Linux环境-->
        <package.environment>dev</package.environment>
        <jdbc.location>classpath:persist.properties</jdbc.location>
    </properties>

    <developers>
        <developer>
            <id>mays</id>
            <name>mays</name>
            <email>lvjavapro@163.com</email>
        </developer>
    </developers>

    <modules>
        <module>ast1949-common</module>
        <module>ast1949-service</module>
        <module>ast1949-persist</module>
          <module>ast1949-photos</module>
  </modules>
//下面是依赖包 <dependencyManagement> <dependencies> <dependency> <groupId>com.zz91</groupId> <artifactId>zz91-utils</artifactId> <version>2.0.1</version> </dependency> <dependency> <groupId>com.zz91</groupId> <artifactId>zz91-search-utils-old</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>simplecaptcha</groupId> <artifactId>simplecaptcha</artifactId> <version>1.2.1</version> </dependency> <dependency> <groupId>patchca</groupId> <artifactId>patchca</artifactId> <version>0.5.0</version> </dependency> <dependency> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId> <version>3.1</version> </dependency> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>com.ast1949</groupId> <artifactId>ast1949-common</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> <dependency> <groupId>com.ast1949</groupId> <artifactId>ast1949-service</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> <dependency> <groupId>com.ast1949</groupId> <artifactId>ast1949-persist</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> <dependency> <groupId>com.zz91</groupId> <artifactId>zz91-mail-client</artifactId> <version>1.1.3-beta</version> </dependency> <dependency> <groupId>com.zz91</groupId> <artifactId>zz91-searchengine</artifactId> <version>1.0.1-SNAPSHOT</version> </dependency> <!-- <dependency> <groupId>com.zz91</groupId> <artifactId>zz91-import</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> --> <dependency> <groupId>com.zz91</groupId> <artifactId>zz91-stat</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.0</version> <scope>test</scope> </dependency> <dependency> <groupId>cactus</groupId> <artifactId>cactus-maven</artifactId> <version>1.7</version> <scope>test</scope> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.14</version> </dependency> <dependency> <groupId>com.sleepycat</groupId> <artifactId>je</artifactId> <version>3.3.82</version> </dependency> <dependency> <groupId>c3p0</groupId> <artifactId>c3p0</artifactId> <version>0.9.1.2</version> </dependency> <dependency> <groupId>org.apache.ibatis</groupId> <artifactId>ibatis-sqlmap</artifactId> <version>2.3.4.726</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.6</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>2.5.6</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>2.5.6</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>2.5.6</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>2.5.6</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>2.5.6</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>2.5.6</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>2.5.6</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>2.5.6</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>2.5.6</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.6.4</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.6.4</version> </dependency> <dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity</artifactId> <version>1.6.1</version> </dependency> <dependency> <groupId>velocity-tools</groupId> <artifactId>velocity-tools</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.2.3</version> <classifier>jdk15</classifier> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <scope>provided</scope> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.4</version> </dependency> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.2.1</version> </dependency> <dependency> <groupId>commons-digester</groupId> <artifactId>commons-digester</artifactId> <version>1.8</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>quartz</groupId> <artifactId>quartz</artifactId> <version>1.5.2</version> </dependency> <dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-core</artifactId> <version>3.3.0</version> </dependency> <dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-demos</artifactId> <version>3.3.0</version> </dependency> <dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-highlighter</artifactId> <version>3.3.0</version> </dependency> <dependency> <groupId>org.wltea.analyzer.lucene</groupId> <artifactId>IKAnalyzer</artifactId> <version>3.2.0</version> </dependency> <dependency> <groupId>net.spy</groupId> <artifactId>memcached</artifactId> <version>2.5rc1</version> </dependency> <dependency> <groupId>jexcelapi</groupId> <artifactId>jxl</artifactId> <version>2.6</version> </dependency> <dependency> <groupId>manentia</groupId> <artifactId>manentia-commons</artifactId> <version>2.0.4</version> </dependency> <dependency> <groupId>org.directwebremoting</groupId> <artifactId>dwr</artifactId> <version>2.0.1</version> </dependency> <dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.9.1</version> </dependency> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.2.2</version> </dependency> <dependency> <groupId>org.jasypt</groupId> <artifactId>jasypt</artifactId> <version>1.5</version> </dependency> <dependency> <groupId>org.tuckey</groupId> <artifactId>urlrewritefilter</artifactId> <version>3.1.0</version> </dependency> <dependency> <!-- jsoup HTML parser library @ http://jsoup.org/ --> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.3.3</version> </dependency> <!-- rpc begin <dependency> <groupId>com.usharp</groupId> <artifactId>usharp-common</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> <dependency> <groupId>com.usharp</groupId> <artifactId>usharp-rpc</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> --> <!--rpc end--> <dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-core</artifactId> <version>1.1.7</version> </dependency> <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> <version>1.6.1</version> </dependency> <dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>msjdbc</artifactId> <version>1.0</version> </dependency> <!-- Open Flash Chart start--> <dependency> <groupId>jofc2</groupId> <artifactId>jofc2</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>com.thoughtworks.xstream</groupId> <artifactId>xstream</artifactId> <version>1.3.1</version> </dependency> <!-- Open Flash Chart end--> <dependency> <groupId>jcifs</groupId> <artifactId>jcifs</artifactId> <version>1.3.14</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.2-FINAL</version> </dependency> <!-- <dependency> <groupId>opensymphony</groupId> <artifactId>sitemesh</artifactId> <version>2.4.2</version> </dependency> --> <dependency> <artifactId>solr-solrj</artifactId> <groupId>org.apache.solr</groupId> <version>3.3.0</version> <scope>compile</scope> </dependency> </dependencies> </dependencyManagement> <repositories> <repository> <id>zz91_repository</id> <name>zz91 local artifactory</name> <url>http://192.168.2.178:8080/artifactory/repo</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>zz91_pluginRepository</id> <name>zz91 local artifactory</name> <url>http://192.168.2.178:8080/artifactory/plugins-releases</url> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>${java.source.version}</source> <target>${java.target.version}</target> <encoding>${encoding}</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> <configuration> <attach>true</attach> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <configuration> <charset>${encoding}</charset> <encoding>${encoding}</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <excludes> <exclude>log4j.properties</exclude> </excludes> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <archive> <addMavenDescriptor>false</addMavenDescriptor> </archive> <webResources> <resource> <!-- this is relative to the pom.xml directory --> <directory>src/main/resources/${package.environment}</directory> <targetPath>WEB-INF/classes</targetPath> <filtering>true</filtering> </resource> </webResources> </configuration> </plugin> <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin> --> </plugins> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/*</include> </includes> <excludes> <exclude>${package.environment}/*</exclude> </excludes> <filtering>true</filtering> </resource> <resource> <directory>src/main/resources/${package.environment}</directory> <includes> <include>**/*</include> </includes> <filtering>true</filtering> </resource> </resources> <testResources> <testResource> <directory>src/test/java</directory> <includes> <include>**/*</include> </includes> </testResource> <testResource> <directory>src/test/resources</directory> <includes> <include>**/*</include> </includes> </testResource> </testResources> </build> <profiles> <profile> <id>dev</id> <properties> <package.environment>dev</package.environment> </properties> </profile> <profile> <id>production</id> <properties> <package.environment>production</package.environment> <jdbc.location>file:/usr/tools/config/db/db-ast.properties</jdbc.location> </properties> </profile> <profile> <id>test</id> <properties> <package.environment>test</package.environment> <jdbc.location>file:/usr/tools/config/db/db-ast.properties</jdbc.location> </properties> </profile> </profiles> </project>



下面为web项目和common,service.persist建立对应的pom文件并且,建立好父子依赖关系

myMainWeb web项目的pom文件

View Code
<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">
<parent>
    <groupId>cn.myBussiness</groupId>
    <artifactId>parent</artifactId>
    <version>1.0-SNAPSHOT</version>
</parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>cn.myBussiness</groupId>
    <artifactId>myMainWeb</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>myMainWeb</name>
    <url>http://maven.apache.org</url>
    <dependencies>
        <dependency>
            <groupId>cn.myBussiness</groupId>
            <artifactId>persist</artifactId>
        </dependency>
        <dependency>
            <groupId>cn.myBussiness</groupId>
            <artifactId>service</artifactId>
        </dependency>
        <dependency>
            <groupId>cn.myBussiness</groupId>
            <artifactId>common</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
        </dependency>
        <dependency>
            <groupId>velocity-tools</groupId>
            <artifactId>velocity-tools</artifactId>
        </dependency>
        <dependency>
            <groupId>net.sf.json-lib</groupId>
            <artifactId>json-lib</artifactId>
            <classifier>jdk15</classifier>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-digester</groupId>
            <artifactId>commons-digester</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
        </dependency>
        <dependency>
            <groupId>quartz</groupId>
            <artifactId>quartz</artifactId>
        </dependency>
        <dependency>
            <groupId>org.tuckey</groupId>
            <artifactId>urlrewritefilter</artifactId>
        </dependency>

        <!--
            rpc begin <dependency> <groupId>com.usharp</groupId>
            <artifactId>usharp-common</artifactId> </dependency> <dependency>
            <groupId>com.usharp</groupId> <artifactId>usharp-rpc</artifactId>
            </dependency> <dependency> <groupId>org.apache.mina</groupId>
            <artifactId>mina-core</artifactId> </dependency>
        -->
        <!--rpc end-->
        <!-- Open Flash Chart start-->
        <dependency>
            <groupId>jofc2</groupId>
            <artifactId>jofc2</artifactId>
        </dependency>
        <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
        </dependency>
        <!-- Open Flash Chart end-->
        <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
        </dependency>
        </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tomcat-maven-plugin</artifactId>
                <configuration>
                    <path>/</path>
                    <port>9090</port>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

common项目的pom

<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">
  	<parent>
		<groupId>cn.myBussiness</groupId>
		<artifactId>parent</artifactId>
		<version>1.0-SNAPSHOT</version>
	</parent>
  <modelVersion>4.0.0</modelVersion>

  <groupId>cn.myBussiness</groupId>
  <artifactId>common</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>common</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  	<build>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>tomcat-maven-plugin</artifactId>
				<configuration>
					<path>/</path>
					<port>9090</port>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>

  service项目

<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">
  <parent>
  <artifactId>parent</artifactId>
  <groupId>cn.myBussiness</groupId>
      <version>1.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <groupId>cn.myBussiness</groupId>
  <artifactId>service</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>service</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
<dependencies>
        <dependency>
            <groupId>cn.myBussiness</groupId>
            <artifactId>common</artifactId>
        </dependency>
        <dependency>
            <groupId>cn.myBussiness</groupId>
            <artifactId>persist</artifactId>
        </dependency>
</dependencies>
</project>

persist项目的pom文件

<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">
    <parent>
        <groupId>cn.myBussiness</groupId>
        <artifactId>parent</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <groupId>cn.myBussiness</groupId>
    <artifactId>persist</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>persist</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>cn.myBussiness</groupId>
            <artifactId>common</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
        </dependency>
        <dependency>
            <groupId>c3p0</groupId>
            <artifactId>c3p0</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.ibatis</groupId>
            <artifactId>ibatis-sqlmap</artifactId>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
        </dependency>
    </dependencies>
</project>

解释一下common web persist 和service的关系

web要依赖其余三个

service要依赖common和persist persist依赖common

这样 项目之间的功能都已经确定完毕,依赖关系也确定完毕.

下一节开始web.xml 等配置文件的配置


转自:http://www.cnblogs.com/leiteng/archive/2013/04/22/3035685

相关问答

更多

Bintray链接到jcenter失踪(Bintray link to jcenter missing)

“添加到JCenter”未启用Enterprise Trial用户。 您需要成为OSS或Premium组织/用户才能将您的软件包链接到JCenter。 我与JFrog ,后面的公司合作 宾特雷和 artifactory 。 "Add To JCenter" is not enabled for Enterprise Trial users. You need to be OSS or Premium organization/user in order to link your packages

缺少神器maven(Missing artifact maven)

我不知道发生了什么,但m2被搞砸了,因为它创建了m2平方米的子文件夹。 当我改变它。 错误得到了解决,感谢快速回复的人。 I do not know what happened but the m2 got screwed up as it created many m2 subfolders in m2. when i changed it. The Error was resolved, thanks for the quick reply guys.

下载maven依赖项时校验和验证失败(Checksum validation failed while downloading maven dependency)

我只是手动下载了JAR文件,校验和是正确的。 您的互联网连接存在问题。 可能是破损的电缆,接口,路由器等,或者是香蕉的防火墙/防病毒软件。 I've just manually downloaded the JAR file and the checksum is the correct one. There is a problem with your internet connection. Probably a broken cable, interface, router, etc.,

如何在swagger-maven-plugin 3.1.0中设置覆盖模型(How to set overriding models in swagger-maven-plugin 3.1.0)

以下是我最终解决问题的方法(我使用的是swagger-maven-plugin 3.1.1版): 假设您要将java.util.Date映射为此任意结构: { "year": "string", "month": "string", "day": "string" } 第1步:创建一个描述上述模型的类: package com.example; import io.swagger.annotations.ApiModel; import io.swagger.annotation

使用2.11在Eclipse Scala-IDE中接收“对org.json4s.JsonAST ...的错误符号引用”(Receiving “bad symbolic reference to org.json4s.JsonAST…” in Eclipse Scala-IDE using 2.11)

您的类路径不完整。 您缺少json4s-core的依赖项。 对类文件'package.class'中遇到的org.json4s.JsonAST.JValue的错误符号引用。 无法在值org.json4s.JsonAST中访问类型JValue。 当前类路径可能缺少org.json4s.JsonAST.JValue的定义 ,或者package.class可能是针对与当前类路径中找到的版本不兼容的版本编译的。 使用Scala或Java库的最简单方法是使用sbt或maven。 它们为您带来(传递性)依赖