Package not found error when building the maven project












0














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










share|improve this question
























  • Package names are lower case . Change MobiOs to mobios
    – user7294900
    Nov 12 '18 at 5:24










  • Then you mean that i cannot add another package compiled library?
    – Kasun Deshapriya
    Nov 12 '18 at 6:05
















0














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










share|improve this question
























  • Package names are lower case . Change MobiOs to mobios
    – user7294900
    Nov 12 '18 at 5:24










  • Then you mean that i cannot add another package compiled library?
    – Kasun Deshapriya
    Nov 12 '18 at 6:05














0












0








0







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










share|improve this question















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







java spring maven






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 '18 at 6:04









Amin Mozhgani

5941520




5941520










asked Nov 12 '18 at 5:03









Kasun Deshapriya

12




12












  • Package names are lower case . Change MobiOs to mobios
    – user7294900
    Nov 12 '18 at 5:24










  • Then you mean that i cannot add another package compiled library?
    – Kasun Deshapriya
    Nov 12 '18 at 6:05


















  • Package names are lower case . Change MobiOs to mobios
    – user7294900
    Nov 12 '18 at 5:24










  • Then you mean that i cannot add another package compiled library?
    – Kasun Deshapriya
    Nov 12 '18 at 6:05
















Package names are lower case . Change MobiOs to mobios
– user7294900
Nov 12 '18 at 5:24




Package names are lower case . Change MobiOs to mobios
– user7294900
Nov 12 '18 at 5:24












Then you mean that i cannot add another package compiled library?
– Kasun Deshapriya
Nov 12 '18 at 6:05




Then you mean that i cannot add another package compiled library?
– Kasun Deshapriya
Nov 12 '18 at 6:05












1 Answer
1






active

oldest

votes


















0














You have two packages with same case insensitive names com.MobiOs to com.mobios which represent physically two directories with same case insensitive names. This can lead to an issue if your file system is case insensitive, or expect specific case as lower case.



Java's package names should be lower case:




Package names are written in all lower case to avoid conflict with the names of classes or interfaces.




If you are not convinced, see comment:




On some versions of some Windows file systems names that are entered in all caps are displayed in all lowercase as the default. This is probably to be friendly towards files from systems that don’t distiguish case — these may come in in all uppercase and look better in all lowercase. While the file name is still uppercase behind the scenes, this may have caused confusion







share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53256201%2fpackage-not-found-error-when-building-the-maven-project%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You have two packages with same case insensitive names com.MobiOs to com.mobios which represent physically two directories with same case insensitive names. This can lead to an issue if your file system is case insensitive, or expect specific case as lower case.



    Java's package names should be lower case:




    Package names are written in all lower case to avoid conflict with the names of classes or interfaces.




    If you are not convinced, see comment:




    On some versions of some Windows file systems names that are entered in all caps are displayed in all lowercase as the default. This is probably to be friendly towards files from systems that don’t distiguish case — these may come in in all uppercase and look better in all lowercase. While the file name is still uppercase behind the scenes, this may have caused confusion







    share|improve this answer


























      0














      You have two packages with same case insensitive names com.MobiOs to com.mobios which represent physically two directories with same case insensitive names. This can lead to an issue if your file system is case insensitive, or expect specific case as lower case.



      Java's package names should be lower case:




      Package names are written in all lower case to avoid conflict with the names of classes or interfaces.




      If you are not convinced, see comment:




      On some versions of some Windows file systems names that are entered in all caps are displayed in all lowercase as the default. This is probably to be friendly towards files from systems that don’t distiguish case — these may come in in all uppercase and look better in all lowercase. While the file name is still uppercase behind the scenes, this may have caused confusion







      share|improve this answer
























        0












        0








        0






        You have two packages with same case insensitive names com.MobiOs to com.mobios which represent physically two directories with same case insensitive names. This can lead to an issue if your file system is case insensitive, or expect specific case as lower case.



        Java's package names should be lower case:




        Package names are written in all lower case to avoid conflict with the names of classes or interfaces.




        If you are not convinced, see comment:




        On some versions of some Windows file systems names that are entered in all caps are displayed in all lowercase as the default. This is probably to be friendly towards files from systems that don’t distiguish case — these may come in in all uppercase and look better in all lowercase. While the file name is still uppercase behind the scenes, this may have caused confusion







        share|improve this answer












        You have two packages with same case insensitive names com.MobiOs to com.mobios which represent physically two directories with same case insensitive names. This can lead to an issue if your file system is case insensitive, or expect specific case as lower case.



        Java's package names should be lower case:




        Package names are written in all lower case to avoid conflict with the names of classes or interfaces.




        If you are not convinced, see comment:




        On some versions of some Windows file systems names that are entered in all caps are displayed in all lowercase as the default. This is probably to be friendly towards files from systems that don’t distiguish case — these may come in in all uppercase and look better in all lowercase. While the file name is still uppercase behind the scenes, this may have caused confusion








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 12 '18 at 6:17









        user7294900

        20.8k103258




        20.8k103258






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53256201%2fpackage-not-found-error-when-building-the-maven-project%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Full-time equivalent

            Bicuculline

            さくらももこ