Expand my Community achievements bar.

com.google.guava not deploying to console when embedded as a third party dependency

Avatar

Level 4

Hello Team,

 

I am trying to embed com.google.guava jar file as a third party dependency in my maven build. But it does not deploy to felix console. When I try to manually upload to felix console it works but not through maven build.

 

I am following the below steps for this.

In the main pom of the project, I am adding it as a dependency.

<dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>20.0</version>
</dependency>

 

In ui.apps, I am embedding it as below.

<embedded>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <target>/apps/my-project/install</target>
</embedded>

 

I have the physical jar file in the above mentioned location as well. I tried similar steps for other jar files and they were deployed to felix console. But only this jar file (com.google.gauva) doesn't deploy.

 

Kindly suggest.

 

5 Replies

Avatar

Level 5

This works for me:

 

1. Add below in main pom (You've already done that):

<dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>20.0</version>
</dependency>

 

2. In core pom:

<project>
  ..
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Include-Resource> @Guava-{version}.jar </Include-Resource>  [Example: @Guava-31.1-jre.jar]
.........
.........
</project>
 
3. In core pom again, add below dependecy:
<dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
</dependency>
 
4. In apps pom, remove the below dependency:
<dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>20.0</version>
</dependency>
 
If this doesn't work, then unpack the jar file for your maven project and see if the guava jar file exists in it?

Avatar

Level 4

Hi @Nikhil_Verma, I tried the way you suggested. It still doesn't work.

Also, I unpacked the jar file and checked for guava jar. Its not there. So it explains why its not deploying but not sure why its not adding to manifest file.

Avatar

Community Advisor

Try below code. It worked for me.

Add below dependency in root pom.xml

<dependencyManagement>
 <dependencies>
   <dependency>
	<groupId>com.google.guava</groupId>
	<artifactId>guava</artifactId>
	<version>20.0</version>
   </dependency>
 </dependencies>
</dependencyManagement>

 core pom.xml

<dependencies>
   <dependency>
	<groupId>com.google.guava</groupId>
	<artifactId>guava</artifactId>
    </dependency>
</dependencies>

in all module's pom.xml

<project>
<build>
        <plugins>
            <!-- ====================================================================== -->
            <!-- V A U L T   P A C K A G E   P L U G I N S                              -->
            <!-- ====================================================================== -->
            <plugin>
                <groupId>org.apache.jackrabbit</groupId>
                <artifactId>filevault-package-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <group><com.project...></group>
                    <packageType>container</packageType>
                    <properties>
                        <cloudManagerTarget>all</cloudManagerTarget>
                    </properties>
                    <!-- skip sub package validation for now as some vendor packages like CIF apps will not pass -->
                    <skipSubPackageValidation>true</skipSubPackageValidation>
                    <embeddeds>
                       
                        <embedded>
                            <groupId>com.google.guava</groupId>
                            <artifactId>guava</artifactId>
                            <target>/apps/<project-name-packages/application/install</target>
                        </embedded>
            
​                    </embeddeds>
					
                </configuration>
            </plugin>
        </plugins>
    </build>
	<dependencies>
	<dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
    </dependencies>
</project>

 

Avatar

Level 4

@HeenaMadan - tried this as well. Still doesn't work. Do you think it has something to do with old archetype version. And something like mentioned in the below link?

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/unable-to-resolve-bundle/t...