Search code examples
javamavendeploymentmulti-module

Does maven need internet connection after Multi module project is deployed on server


I am having a large non maven project in company and having multiple projects as module which are added as deployment assembly in parent project.

Company is planning to integrate maven which can be achieved by creating Multi Module maven project but maven requires internet connection. There is no problem while developing but after deployment internet connection is blocked on server system. I have two questions:

1) Does maven requires internet connection after it is built and deployed on server?

2) Packaging is restricted to pom for aggregator project. How can it be deployed on server since there is no war for aggregator project?


Solution

  • Maven can manage a project's build, reporting and documentation from a central piece of information.

    Maven is used when building packages, installing dependencies, deploying packages, it can also run unit tests during building. After packaging, the package has nothing to do with maven. Just forget about maven after building. So there's no need network connecting when running your project.

    For multiple modules, you can integrate all the modules as single maven project. They can be installed in local maven repository. The installed modules, usually as jar file just the same as other open source jars. You can run mvn clean install to install your module in repository. Eg, com/yourcompany/module1.jar.

    In your main project, you can add dependencies in pom.xml like

        <dependency>
            <groupId>com.yourcompany</groupId>
            <artifactId>module1</artifactId>
            <version>1.0.0</version>
        </dependency>
    

    which means your main project depends on module1.