编译依赖maven的java文件,在使用maven编译时,是否有必要在/ src / main / java中使用.java文件?...

I tried to convert a project to a maven one... it has its .java files in other location than /src/main/java , when i run maven install, all the files (.hbm , .xml) except those .class occurs in my jar.

This is build part from pom.xml :

${basedir}/src

**/*.java

maven-compiler-plugin

1.5

1.5

true

1.5

UTF-8

Using the above code, .class files are missing from my jar... and no error messages are displayed on console, is it necessary to move them to /src/main/java package structure ?

Also, what could be the reason for this behavior , some missing dependencies ?

I did a change moving them to , src/main/java and i got some exceptions on console , but i am still confused if i "must" add them to this "src/main/java" structure...

Please give me an idea about this...

Thanks

解决方案

You can configure the source directory to be the same as the resources like this:

${basedir}/src

${basedir}/src

**/*.java

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值