Maven Assembly Plugin - install the created assembly

前端 未结 3 707
执念已碎
执念已碎 2021-02-08 00:27

I have a project that simply consists of files. I want to package those files into a zip and store them in a maven repository. I have the assembly plugin configured to build t

3条回答
  •  花落未央
    2021-02-08 00:52

    I have the assembly plugin configured to build the zip file and that part works just fine, but I cannot seem to figure out how to install the zip file?

    Well, the created assembly should get automatically attached to the project and then uploaded into the repository on an install and deploy goal. Can you show your pom?

    Update: With your current configuration, I don't think that the assembly gets created as part of your build. You need to bind the single goal to a lifecycle phase, typically package:

      
        maven-assembly-plugin
        2.2-beta-5
        
          
            ../packaging.xml
          
        
        
          
            make-assembly 
            package 
            
              single 
            
          
        
      
    

    And now it should get installed/deployed properly.

    Also, if I want to use this assembly in another artifact, how would I do that? I am intending on calling dependency:unpack, but I don't have an artifact in the repository to unpack.

    You can declare a dependency on an assembly (using the right classifier and type in your case) but since dependency are resolved through the repository, you'll need to solve the first step first. Then, declare something like this (where the classifier is the assembly's id):

    
      com. ... .virtualHost
      ***
      0.0.1
      ...
      zip
    
    

提交回复
热议问题