Multiple install:install-file in a single pom.xml
I would imagine something like this would work (this will install it on every build):
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<executions>
<execution>
<id>inst_1</id>
<phase>initialize</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<!-- config for file 1 -->
</configuration>
</execution>
<execution>
<id>inst_2</id>
<phase>initialize</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<!-- config for file 2 -->
</configuration>
</execution>
<!-- execution file 3... -->
</executions>
</plugin>
</plugins>
</build>
Related videos on Youtube
matbrgz
~50 milliskeet Senior Developer currently doing CI-CD related work at https://www.ufst.dk/ CV/resume: https://ravn.github.io/cv/ Smallest Hello World program I could write using the Dagger 2 dependency injection framework: https://github.com/ravn/dagger2-hello-world Smallest "Inject configuration strings with @Named" I could write using the Dagger 2 dependency injection framework: https://github.com/ravn/dagger2-named-string-inject-example Adding logging at class load time with instrumentation: An article I wrote way back for java.net to demonstrate what Java agents could help with.
Updated on September 14, 2022Comments
-
matbrgz about 1 year
(Please read at least this before answering: This is a temporary measure! No, we do not want to set up a local repository manager and manually run a script)
We have a legacy project with a few dependencies which we have a local copy of including source and javadoc, and which has been proven to work well in production, but which is not available in the same quality in Central. We want to use those jars we already have.
I have found that I can manually run a suitably complex
mvn install:install-file
command to get the artifacts injected in the repository of the local machine, but I would like to have it work as part of the normal maven build of our various modules.Given I have an otherwise blank module containing multiple jars which each need to be inserted with an
install:install-file
how should I do this in my pom.xml to be fully conformant with the normal Maven build?Or can I just attach multiple jars to be the output of the module and somehow attach javadoc and source too)?
(and, please, no suggestion about submitting to central or setting up a local repository manager. This is a temporary solution until we have an opportunity to upgrade to a newer version of the dependencies)
-
medge almost 9 yearsI believe there is an error in this answer.
<phase>initialize</phase>
had to be changed to<phase>install</phase>
for me in Eclipse Luna. Otherwise Eclipse would flag it as an invalid lifecycle