I have a weird problem - Some class file couldn\'t be read during maven build.
A
and project B
.It also matters the order of the dependencies. I've had the same issue. And basically I had to put first the scope test
and then scope compile
dependencies in the pom.xml
. If I put first the scope compile
and then the scope test
it will fail.
I had the same issue (even though the project was compiling/working fine in Eclipse), it was not when using the command line build. The reason was that I wasn't using the correct folder structure for mvn: "src/main/java/com" etc. It is looking at these folders by default (I was using "/scr/main/com" etc. which caused issues).
Try to use:
mvn clean package install
This command should install your artifacts in you local maven repo.
PS: I see that this is an old question, but it may be helpful for somebody in the future.
go to the maven repository and open the jar [tip: you can use winzip] of the source module to verify the specific class present.
In my case it is not. Then I found below.
if you are using the plugin org.apache.felix/maven-bundle-plugin
Make sure source module has export-package defined
example: com.xxx.camel.dao
The error is pretty clear: "cannot find symbol". Some dependencies can't be resolved (you even have the line and column in the trace of the reference that can't be resolved):
V:/dhs_tss_build_view/dhs_tssproject/tss/tsscommon-server/src/main/java/us/mn/state/dhs/tss/common/oblix/da/wsdl/OblixLoginAc
cess.java:[51,60] cannot find symbol
symbol : class BusinessException
location: class us.mn.state.dhs.tss.common.oblix.da.wsdl.OblixLoginAccess
V:/dhs_tss_build_view/dhs_tssproject/tss/tsscommon-server/src/main/java/us/mn/state/dhs/tss/common/app/da/ldap/BaseLdapImpl.j
ava:[187,14] cannot find symbol
symbol : class Phone
location: class us.mn.state.dhs.tss.common.app.da.ldap.BaseLdapImpl
V:/dhs_tss_build_view/dhs_tssproject/tss/tsscommon-server/src/main/java/us/mn/state/dhs/tss/common/app/da/ldap/BaseLdapImpl.j
ava:[204,14] cannot find symbol
symbol : class Phone
location: class us.mn.state.dhs.tss.common.app.da.ldap.BaseLdapImpl
Below a couple of things to verify:
Maven is working fine, you have a mistake somewhere.
I had the same problem...
How to fix - add the following properties in to the pom.xml
<properties>
<!-- compiler settings -->
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>