0

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?

  • 2
    Maven is a build tool. You don't need it at runtime. At runtime you just deploy the code that Maven has built, and which is completely independent of Maven. Why would you want to deploy the aggregator project? As you said, it's just an aggregator, which has no code at all. – JB Nizet Oct 30 '18 at 07:05
  • @NishitKakkad For the first question, you can look at this [topic](https://stackoverflow.com/questions/6609443/maven-installation-and-using-in-project-without-internet-conncetion) – Dang Nguyen Oct 30 '18 at 07:06
  • Thanks for the reply. Got answer for the first one. For second, child module war should be deployed on server as I understand from your comment. – Nishit Kakkad Oct 30 '18 at 07:17

1 Answers1

0

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.

Bejond
  • 1,188
  • 1
  • 11
  • 18