Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8503959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:53:49+00:00 2026-06-11T01:53:49+00:00

I’m trying to have a Project B pull down (and unpack) a ZIP built

  • 0

I’m trying to have a Project B pull down (and unpack) a ZIP built by Project A and deployed to a remote repository.

The ZIP is created and attached using the maven-assembly-plugin, with packaging type pom:

<artifactId>project-a</artifactId>
<name>ZIP</name>
<description>Used by Project B</description>
<packaging>pom</packaging>

...

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-assembly-plugin</artifactId>
  <executions>
    <execution>
      <id>distribution-package</id>
      <phase>package</phase>
      <goals>
        <goal>single</goal>
      </goals>
      <configuration>
        <descriptors>
          <descriptor>src/main/assembly/scripts.xml</descriptor>
        </descriptors>
        <tarLongFileMode>gnu</tarLongFileMode>
      </configuration>
    </execution>
  </executions>
</plugin>

Attempting to pull it down from Project B‘s pom with the maven-dependency-plugin:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>
  <executions>
    <execution>
      <id>copy-scripts</id>
      <phase>package</phase>
      <goals>
        <goal>copy</goal>
      </goals>
      <configuration>
        <outputDirectory>${basedir}/target/staging</outputDirectory>
        <stripVersion>true</stripVersion>
        <artifactItems>
          <artifactItem>
            <groupId>...</groupId>
            <artifactId>...</artifactId>
            <version>...</version>
            <overWrite>true</overWrite>
            <type>zip</type>
          </artifactItem>
        </artifactItems>
      </configuration>
    </execution>
  </executions>
</plugin>

fails with: [ERROR] Failed to execute goal on project ...: Could not resolve dependencies for project group:artifact:pom:version: Could not find artifact group:project-a:zip:version in nexus (http://...:8081/nexus/content/groups/public) -> [Help 1]

I would assume this is because I specified Project A‘s packaging as pom and not zip, however I can’t specify Project A as packaging type zip because it results in:

[ERROR]     Unknown packaging: zip @ line 13, column 13

Am I doing something wrong here or is this simply not possible?
I just have a bunch of files that I want to bundle up into an artifact and allow multiple other projects to download and unpack them for use. Open to different suggestions…

I’ve also checked to make sure that the assembled zip is indeed in the nexus.

UPDATED WITH ANSWER

For anyone else’s benefit, what I was missing is that the <classifier> of the dependency has to match the <id> of the assembly. Notice where thisistheattachedartifactsclassifier is specified in the following files.

scripts.xml (Project A):

<assembly>
  <id>thisistheattachedartifactsclassifier</id>
  <formats>
    <format>zip</format>
  </formats>

  <fileSets>
    <fileSet>
      <directory>src/main/resources</directory>
      ...
    </fileSet>
  </fileSets>
</assembly>

pom.xml (Project B):

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>
  <executions>
    <execution>
      <id>copy-scripts</id>
      <phase>package</phase>
      <goals>
        <goal>copy</goal>
      </goals>
      <configuration>
        <outputDirectory>${basedir}/target/staging</outputDirectory>
        <stripVersion>true</stripVersion>
        <artifactItems>
          <artifactItem>
            <groupId>...</groupId>
            <artifactId>...</artifactId>
            <version>...</version>
            <classifier>thisistheattachedartifactsclassifier</classifier>
            <overWrite>true</overWrite>
            <type>zip</type>
          </artifactItem>
        </artifactItems>
      </configuration>
    </execution>
  </executions>
</plugin>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:53:50+00:00Added an answer on June 11, 2026 at 1:53 am

    Welcome to Stack Overflow :).

    You are on the right way. Your real problem is using a zip.

    The following configuration is ok and work great for me. It’s an old one (2 years ago), and I’m not sure that match the best practices. But I Know that’s working.

    This allow me to share some resources between projects, especially for unit tests.

    Zip Project :

    pom.xml

    <groupId>com.mycompany</groupId>
    <artifactId>cfg_dev</artifactId>
    <version>1.1.0</version>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>cfg-main-resources</id>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <descriptors>
                                <descriptor>/src/main/assembly/resources.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    

    Assembly descriptor :
    It will produce this artifact : cfg_dev-1.1.0-resources.zip
    Please, note that

    1. this is a zip archive
    2. the “classifier” is resources (like assembly name)

      resources

      zip

      false

      src/main/resources

    Main Project :

    pom.xml

    Please, note that

    1. this depends on a zip archive
    2. the dependency “classifier” is resources (like previous assembly name)

      <!-- Unit test dependency -->
      <dependency>
          <groupId>com.mycompany</groupId>
          <artifactId>cfg_dev</artifactId>
          <version>${project.version}</version>
          <classifier>resources</classifier>
          <type>zip</type>
          <scope>test</scope>
      </dependency>
      
        ....
      
      <build>
        <testResources>
          <!-- Ressources habituelles  -->
          <testResource>
              <directory>src/test/resources</directory>
              <filtering>true</filtering>
          </testResource>
          <!-- Unzipped resources from cfg_dev  -->
          <testResource>
              <directory>${project.build.directory}/test-resources</directory>
              <filtering>true</filtering>
          </testResource>
      </testResources>
      
      <plugins>
      
          <!-- Unzip shared resources -->
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-dependency-plugin</artifactId>
              <executions>
                  <execution>
                      <id>unpack-cfg-test-resources</id>
                      <goals>
                          <goal>unpack-dependencies</goal>
                      </goals>
                      <phase>generate-test-resources</phase>
                      <configuration>
                          <outputDirectory>${project.build.directory}/test-resources</outputDirectory>
                          <includeArtifactIds>cfg_dev</includeArtifactIds>
                          <includeGroupIds>${project.groupId}</includeGroupIds>
                          <excludeTransitive>true</excludeTransitive>
                          <excludeTypes>pom</excludeTypes>
                          <scope>test</scope>
                      </configuration>
                  </execution>
              </executions>
          </plugin>
        </plugins>
      

    I hope this is clear and that will help you 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.