I have created a maven project and i am going to use a .jar file that already created by someone. I have added it into the class path and used it and there are no errors showing in eclipse. But when i try to clean build the project there is an error as follows.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project DigitalWallet: Compilation failure: Compilation failure: [ERROR] /E:/DigitalWallet_V0.1/DigitalWallet/src/main/java/com/MobiOs/config/Log4jConfig.java:[11,23] package com.mobios.util does not exist [ERROR] /E:/DigitalWallet_V0.1/DigitalWallet/src/main/java/com/MobiOs/config/Log4jConfig.java:[25,17] cannot find symbol [ERROR] symbol: variable LogUtil [ERROR] location: class com.MobiOs.config.Log4jConfig [ERROR] /E:/DigitalWallet_V0.1/DigitalWallet/src/main/java/com/MobiOs/config/Log4jConfig.java:[26,17] cannot find symbol [ERROR] symbol: variable LogUtil [ERROR] location: class com.MobiOs.config.Log4jConfig [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
It saying the package com.mobios.util does not exist.
@Configuration
@EnableTransactionManagement
@ComponentScan({ "com.MobiOs.config", "com.mobios.util" })
public class Log4jConfig {
@Bean
public void initilizeLog4j() throws UnsupportedEncodingException {
LogUtil.init("/conf/log4j.xml");
LogUtil.getEventLog().debug("Kasun" +
",SERVICE_INITIALIZED,initialized_logs,,");
}
}
In web Config i have set the component scan also`
@Configuration
@EnableWebMvc
@ComponentScan({ "com.MobiOs", "com.mobios" })
public class WebConfig {
}
But i am getting the above error.
Note : My package name is com.MobiOs.config But the imported jar package name is com.mobios.util