wiziorew.blogg.se

Maven install dependency from pom command line
Maven install dependency from pom command line






  1. Maven install dependency from pom command line install#
  2. Maven install dependency from pom command line code#

This is what going wrong, the install:file -Dfile -DgroupId -D. Then I went to ~/.m2/repository/./target/1.0.0/target.pom to find the pom file of the target, but nothing in it!. Now I have a target.jar (it has a dependencies list : a.jar, b.jar, c.jar.), I want to use mvn install:install-file to put it into my local repo, but when I run the command blow mvn install:install-file -Dfile=/Users/username/./target.jar -DgroupId= -DartifactId=target -Dversion=1.0.0īut when I use it I found there are many error, the jar which use target.jar cannot find a.jar, b.jar, c.jar, such as: does not exist But I haven't seen any real consequences of that. The only downside I see to this approach is that the artifact gets deployed as type pom instead of type jar.

  • The children have to be declared as having pom because you can't add a jar to an artifact if it has the same name as the artifact.
  • Maven install dependency from pom command line code#

  • The children need to specify the build-helper-maven-plugin under the build plugins so that code from the parent gets run.
  • Maven install dependency from pom command line install#

    The attach-artifact execution should be under so it doesn't get executed if you mvn install or mvn deploy the parent pom.Some of the pieces of this that initially tripped me up:

    maven install dependency from pom command line

    Inspired by a post to the maven-users list and using the build-helper plugin, in the parent pom, I have: Ok, I found a solution that allows me to run just mvn install or mvn deploy and have the jar file installed to the local or remote repository.

  • Be able to run something like mvn install or mvn deploy without having to specify all those complicated command line propertiesĮdit: Made it clearer above that ideally I'd like to be able to run something as simple as mvn install or mvn deploy and not have to specify properties on the command line.
  • maven install dependency from pom command line

  • Write an additional minimal pom for each third party jar.
  • Put the common code for all the third party jars in one shared parent pom.
  • I feel like I'm probably going about this the wrong way. Presumably I could do something similar to get mvn install:install-file to work.īut with this approach, I'm unable to release the parent pom (which I must do since the child poms depend on it), and if I try to mvn release:perform on the parent pom, I get errors like: Cannot override read-only parameter: pomFile That allows me to run mvn deploy:deploy-file to deploy all the child pom artifacts.

    maven install dependency from pom command line

    To get this to work, at least for deploying, I tried putting the following in my parent pom: Īnd then having each of the child poms define the jarfile property. I'd like to be able to install or deploy these dependencies with something as simple as mvn install and mvn deploy (or maybe mvn install:install-file and mvn deploy:deploy-file) and have all the necessary properties for these commands ( artifactId, repositoryId, etc.) be read from the pom.xml files.

    maven install dependency from pom command line

    These pom.xml files all have a common parent pom that declares some of the common info (e.g. We've made pom.xml files for each jar file that declare the groupId, artifactId, dependencies, etc. Some of the jar files have their own dependencies and we also need to declare these. For each of these we have a jar file that we'd like to be able to install and/or deploy to our repository. We have a number of third party dependencies that aren't hosted anywhere.








    Maven install dependency from pom command line