jdevelop
jdevelop

Reputation: 12296

maven :: install multiple third-party artifacts to local repository at once from filesystem

We're using non-public artifacts from third-party companies in our project. We don't have maven proxy installed (and there're no plants to do so, because we found it complicates things rather than solves problems. especially if no internet connection or VPN is available).

So I created set of 'maven install file' plugin executions, like this:

        <plugin>
            <artifactId>maven-install-plugin</artifactId>
            <version>2.3.1</version>
            <inherited>false</inherited>
            <executions>
                <execution>
                    <id>install-artifacts.1</id>
                    <goals>
                        <goal>install-file</goal>
                    </goals>
                    <phase>initialize</phase>
                    <configuration>
                        <pomFile>thirdparty/gwt-0.99.1.pom</pomFile>
                        <file>thirdparty/gwt-0.99.1.jar</file>
                    </configuration>
                </execution>
                <execution>
                    <id>install-artifacts.2</id>
                    <goals>
                        <goal>install-file</goal>
                    </goals>
                    <phase>initialize</phase>
                    <configuration>
                        <pomFile>thirdparty/morphia-0.99.1.pom</pomFile>
                        <file>thirdparty/morphia-0.99.1.jar</file>
                    </configuration>
                </execution>
                <execution>
                    <id>install-artifacts.3</id>
                    <goals>
                        <goal>install-file</goal>
                    </goals>
                    <phase>initialize</phase>
                    <configuration>
                        <pomFile>thirdparty/gwt-oauth2-0.2-alpha.pom</pomFile>
                        <file>thirdparty/gwt-oauth2-0.2-alpha.jar</file>
                    </configuration>
                </execution>
            </executions>
        </plugin>

it works great and does exactly what we need. However if new artifact is added - new big XML section has to be added.

Is there any way to avoid this, like use 'yet another plugin' which will search for folder and install everything from it?

Upvotes: 3

Views: 2773

Answers (1)

khmarbaise
khmarbaise

Reputation: 97427

Best solution for such kind of thing is to install a repository manager. You've written you won't installing a proxy but that's the wrong way. The only solution to solve such kind of problems is to install a repository manager.

Upvotes: 3

Related Questions