Scala/Java Project not finding Dependencies during Maven compile -
i have java/scala hybrid project. when building in intellij, things work fine. however, trying run maven builds command line giving me error when running 'mvn clean install':
[error] /ideaprojects/user-lib-common/src/main/scala/com/test/userlib/rest/userservicerestclient.scala:12: error: object model not member of package com.test.userlib [error] import com.test.userlib.model.cte.{itemresponse, cteuser} [error] ^ [error] /ideaprojects/user-lib-common/src/main/scala/com/test/userlib/rest/userservicerestclient.scala:13: error: object utils not member of package com.test.userlib [error] import com.test.userlib.utils.userlibproperties [error] ^ [error] /ideaprojects/user-lib-common/src/main/scala/com/test/userlib/rest/userservicerestclient.scala:26: error: not found: value userlibproperties [error] .hosts(userlibproperties.cte_userservice_host + ":" + userlibproperties.cte_userservice_port) [error] ^ [error] /ideaprojects/user-lib-common/src/main/scala/com/test/userlib/rest/userservicerestclient.scala:32: error: not found: value userlibproperties [error] clientauthtlsconfigutil.createsslcontext(new file(userlibproperties.cte_userservice_keystore),userlibproperties.cte_userservice_keystore_password,new file(userlibproperties.cte_userservice_truststore),userlibproperties.cte_userservice_truststore_password) [error] ^ [error] /ideaprojects/user-lib-common/src/main/scala/com/test/userlib/rest/userservicerestclient.scala:35: error: not found: type cteuser [error] protected def getuser(dn :string) :cteuser = { [error] ^ [error] /ideaprojects/user-lib-common/src/main/scala/com/test/userlib/rest/userservicerestclient.scala:36: error: not found: value userlibproperties [error] val rb = requestbuilder().url(s"${userlibproperties.cte_userservice_endpoint}/user?dn=${urlencoder.encode(dn,"utf-8")}&aacattribs=true").buildget [error] ^ [error] /ideaprojects/user-lib-common/src/main/scala/com/test/userlib/rest/userservicerestclient.scala:42: error: not found: type itemresponse [error] case httpresponsestatus.ok => new objectmapper().readvalue(resptry.get.getcontent.tostring("utf-8"), classof[itemresponse]).getitem.getuser [error] ^ [error] 7 errors found
so, scala class isn't finding java dependencies needs. here's project's structure:
and here build portion of pom.xml:
<build> <sourcedirectory>src/main/scala</sourcedirectory> <testsourcedirectory>src/test/scala</testsourcedirectory> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <plugin> <groupid>net.alchim31.maven</groupid> <artifactid>scala-maven-plugin</artifactid> <executions> <execution> <id>scala-compile-first</id> <phase>process-resources</phase> <goals> <goal>add-source</goal> <goal>compile</goal> </goals> </execution> <execution> <id>scala-test-compile</id> <phase>process-test-resources</phase> <goals> <goal>testcompile</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
do have add classpath scala compiler somehow?
i think userlibproperties file should in proper file extension userlibproperties.scala. please check folder , list command , check file extensions, in intelij work without proper extension.
Comments
Post a Comment