java - Error while building spring boot project -
this question has answer here:
i unable build springboot project, using classes springboot jar, placed on build path, running in local via eclipse, not building, here's error
"[info] scanning projects... [info] [info] ------------------------------------------------------------------------ [info] building contentmanagementservice 0.0.1 [info] ------------------------------------------------------------------------ [info] [info] --- maven-clean-plugin:2.5:clean (default-clean) @ contentmanagementapi --- [info] deleting /home/bhargavgundu/git/contentmanagementservice/target [info] [info] --- maven-resources-plugin:2.6:resources (default-resources) @ contentmanagementapi --- [info] using 'utf-8' encoding copy filtered resources. [info] copying 1 resource [info] copying 5 resources [info] [info] --- maven-compiler-plugin:3.1:compile (default-compile) @ contentmanagementapi --- [info] changes detected - recompiling module! [info] compiling 42 source files /home/bhargavgundu/git/contentmanagementservice/target/classes [info] ------------------------------------------------------------- [error] compilation error : [info] ------------------------------------------------------------- [error] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/contentmanagementcontrollerv1.java:[32,31] package com.conduiraonline.apis not exist [error] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/contentmanagementcontrollerv1.java:[42,31] package com.conduiraonline.daos not exist [error] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/contentmanagementcontrollerv1.java:[52,35] cannot find symbol symbol: class slackservice location: package com.conduiraonline.services [error] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/contentmanagementcontrollerv1.java:[85,17] cannot find symbol symbol: class userdao location: class com.conduiraonline.controller.contentmanagementcontrollerv1 [error] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/contentmanagementcontrollerv1.java:[87,17] cannot find symbol symbol: class slackservice location: class com.conduiraonline.controller.contentmanagementcontrollerv1 [error] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/contentmanagementcontrollerv1.java:[95,17] cannot find symbol symbol: class licensev5 location: class com.conduiraonline.controller.contentmanagementcontrollerv1 [info] 6 errors [info] ------------------------------------------------------------- [info] ------------------------------------------------------------------------ [info] build failure [info] ------------------------------------------------------------------------ [info] total time: 1.917s [info] finished at: tue sep 12 17:16:44 ist 2017 [info] final memory: 24m/396m [info] ------------------------------------------------------------------------ [error] failed execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project contentmanagementapi: compilation failure: compilation failure: [error] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/contentmanagementcontrollerv1.java:[32,31] package com.conduiraonline.apis not exist [error] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/contentmanagementcontrollerv1.java:[42,31] package com.conduiraonline.daos not exist [error] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/contentmanagementcontrollerv1.java:[52,35] cannot find symbol [error] symbol: class slackservice [error] location: package com.conduiraonline.services [error] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/contentmanagementcontrollerv1.java:[85,17] cannot find symbol [error] symbol: class userdao [error] location: class com.conduiraonline.controller.contentmanagementcontrollerv1 [error] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/contentmanagementcontrollerv1.java:[87,17] cannot find symbol [error] symbol: class slackservice [error] location: class com.conduiraonline.controller.contentmanagementcontrollerv1 [error] /home/bhargavgundu/git/contentmanagementservice/src/main/java/com/conduiraonline/controller/contentmanagementcontrollerv1.java:[95,17] cannot find symbol [error] symbol: class licensev5 [error] location: class com.conduiraonline.controller.contentmanagementcontrollerv1 [error] -> [help 1] [error] [error] see full stack trace of errors, re-run maven -e switch. [error] re-run maven using -x switch enable full debug logging. [error] [error] more information errors , possible solutions, please read following articles: [error] [help 1] http://cwiki.apache.org/confluence/display/maven/mojofailureexception "
it showing errors wherever using classes/functions external jar, can help? pom-
here 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/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.conduiraonline</groupid> <artifactid>contentmanagementapi</artifactid> <version>0.0.1</version> <packaging>jar</packaging> <name>contentmanagementservice</name> <description>contentmanagementservice</description> <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.3.3.release</version> <relativepath /> <!-- lookup parent repository --> </parent> <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-web</artifactid> <exclusions> <exclusion> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-logging</artifactid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-actuator</artifactid> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-jdbc</artifactid> </dependency> <dependency> <groupid>mysql</groupid> <artifactid>mysql-connector-java</artifactid> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-log4j</artifactid> </dependency> <!-- https://mvnrepository.com/artifact/javax.mail/mail --> <dependency> <groupid>javax.mail</groupid> <artifactid>mail</artifactid> <version>1.4</version> </dependency> <dependency> <groupid>com.conduiraonline</groupid> <artifactid>licenseapi</artifactid> <version>0.0.1</version> <classifier>exec</classifier> </dependency> <dependency> <groupid>com.google.guava</groupid> <artifactid>guava</artifactid> <version>21.0</version> </dependency> <dependency> <groupid>com.google.code.gson</groupid> <artifactid>gson</artifactid> </dependency> <dependency> <groupid>com.fasterxml.jackson.core</groupid> <artifactid>jackson-core</artifactid> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-test</artifactid> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-maven-plugin</artifactid> <configuration> <executable>true</executable> </configuration> </plugin> </plugins> </build> </project>
tl;dr
remove <classifier>exec</classifier>
dependency on com.conduiraonline:licenseapi
more details ...
you correct in using <dependency>
express relationship between com.conduiraonline:contentmanagementapi
, com.conduiraonline:licenseapi
. or put way; right way tell maven module com.conduiraonline:contentmanagementapi
depends on module com.conduiraonline:licenseapi
.
however, have defined dependency on com.conduiraonline:licenseapi
as:
<dependency> <groupid>com.conduiraonline</groupid> <artifactid>licenseapi</artifactid> <version>0.0.1</version> <classifier>exec</classifier> </dependency>
the classifier
tells maven file named licenseapi.exec
in folder com/conduiraonline
in local maven repo (and failing that, try resolve dependency whatever remote repositories have configured in maven settings.xml or in pom.xml).
i presume there no file named licenseapi.exec
in folder com/conduiraonline
in local maven repo because exec
unusual classifier maven artifact.
as long jar com.conduiraonline:licenseapi
version 0.0.1
has been installed in local maven repo dependency work:
<dependency> <groupid>com.conduiraonline</groupid> <artifactid>licenseapi</artifactid> <version>0.0.1</version> </dependency>
you install jar com.conduiraonline:licenseapi
version 0.0.1
in local maven repo running mvn clean install
licenseapi
module (assuming pom.xml licenseapi
modules has <version>0.0.1</version>
).
Comments
Post a Comment