In general, the essence is quite clear, for some reason does not want to add the desired dependency.

<dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>5.1.5.RELEASE</version> </dependency> 

I tried all versions, tried re-import, Google is silent. Anyway, there is no jarki in the META-INF / lib folder. I suspect that the matter is in some kind of dependency conflict, but I have no idea how to solve it. I ask for help

Pom file

  <?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>org.dikhim</groupId> <artifactId>web-primefaces</artifactId> <version>1.0-SNAPSHOT</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <jdk.version>1.8</jdk.version> <spring.version>4.3.2.RELEASE</spring.version> <servlet.version>3.1.0</servlet.version> <jsf.version>2.2.8</jsf.version> <primefaces.version>6.0</primefaces.version> </properties> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>${servlet.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>5.4.2.Final</version> </dependency> <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-api</artifactId> <version>${jsf.version}</version> </dependency> <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-impl</artifactId> <version>${jsf.version}</version> </dependency> <dependency> <groupId>org.primefaces</groupId> <artifactId>primefaces</artifactId> <version>${primefaces.version}</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <finalName>JavaServerFaces</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.6.0</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> </project> 

mvn dependency: tree

 [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ web-primefaces --- [INFO] org.dikhim:web-primefaces:jar:1.0-SNAPSHOT [INFO] +- org.springframework:spring-jdbc:jar:4.3.2.RELEASE:compile [INFO] | +- org.springframework:spring-beans:jar:4.3.2.RELEASE:compile [INFO] | +- org.springframework:spring-core:jar:4.3.2.RELEASE:compile [INFO] | | \- commons-logging:commons-logging:jar:1.2:compile [INFO] | \- org.springframework:spring-tx:jar:4.3.2.RELEASE:compile [INFO] +- org.springframework:spring-context:jar:4.3.2.RELEASE:compile [INFO] | +- org.springframework:spring-aop:jar:4.3.2.RELEASE:compile [INFO] | \- org.springframework:spring-expression:jar:4.3.2.RELEASE:compile [INFO] +- org.springframework:spring-orm:jar:4.3.2.RELEASE:compile [INFO] +- org.hibernate:hibernate-core:jar:5.4.2.Final:compile [INFO] | +- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile [INFO] | +- javax.persistence:javax.persistence-api:jar:2.2:compile [INFO] | +- org.javassist:javassist:jar:3.24.0-GA:compile [INFO] | +- net.bytebuddy:byte-buddy:jar:1.9.10:compile [INFO] | +- antlr:antlr:jar:2.7.7:compile [INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.1.1.Final:compile [INFO] | +- org.jboss:jandex:jar:2.0.5.Final:compile [INFO] | +- com.fasterxml:classmate:jar:1.3.4:compile [INFO] | +- javax.activation:javax.activation-api:jar:1.2.0:compile [INFO] | +- org.dom4j:dom4j:jar:2.1.1:compile [INFO] | +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.0.Final:compile [INFO] | +- javax.xml.bind:jaxb-api:jar:2.3.1:compile [INFO] | \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.1:compile [INFO] | +- org.glassfish.jaxb:txw2:jar:2.3.1:compile [INFO] | +- com.sun.istack:istack-commons-runtime:jar:3.0.7:compile [INFO] | +- org.jvnet.staxex:stax-ex:jar:1.8:compile [INFO] | \- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.15:compile [INFO] +- junit:junit:jar:3.8.1:test [INFO] +- org.springframework:spring-webmvc:jar:4.3.2.RELEASE:compile [INFO] | \- org.springframework:spring-web:jar:4.3.2.RELEASE:compile [INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:provided [INFO] +- com.sun.faces:jsf-api:jar:2.2.8:compile [INFO] +- com.sun.faces:jsf-impl:jar:2.2.8:compile [INFO] \- org.primefaces:primefaces:jar:6.0:compile 
  • Give your entire pom file + (if possible) dependency tree - Chubatiy 1:29 pm
  • @Chubatiy added - Serhii Dikobrazko
  • Specify the same version of spring.version for all dependencies (that is, if you need jdbc 5.1.5.RELEASE, then specify this for all). And then you yourself will pull it up (you already have spring jdbc in pom). You replaced the current dependency with a new one? Or just added on top? - Chubatiy

1 answer 1

Add to pom.xml

 <packaging>war</packaging> 

If the project is properly configured, then war will build without problems. Otherwise, you will have to add a plug-in section to the war section and explicitly set paths to the web resources.

  • Firstly it does not work, secondly provided means that the dependency must be provided by the application server, it will not be guaranteed to be packaged. If I understand everything correctly - Serhii Dikobrazko
  • I really messed up. (updated the answer) - keekkenen
  • Yes. For sure. At some point I lost the line. That is, prior to this, the project was going by the very idea itself and for some reason suddenly decided that some kind of dependence was superfluous - Serhii Dikobrazko