AWS SDK NoClassDefFoundError - java

I am currently trying to use the AWS SDK (specifically the s3 SDK) in my project but keep getting the exception
java.lang.NoClassDefFoundError:com/amazonaws/services/s3/AmazonS3ClientBuilder
I have imported the SDK into my project using maven as shown in the SDK documentation here. The code that I am running that causes this to occur is
AmazonS3 amazonS3 = AmazonS3ClientBuilder.standard().withRegion(Regions.EU_WEST_1).build();
I suspected the issue may have been occurring due to a conflict in Jackson versions between the version required by the AWS SDK and the version I was importing myself for use else where in the project although changing this does not seem to have resolved the issue. I will include my POM.xml file below.
Thanks in advance.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.projectname.restservice</groupId>
<artifactId>ProjectName</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>ProjectName</name>
<build>
<finalName>ProjectName</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<inherited>true</inherited>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>2.16</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-bom</artifactId>
<version>1.11.22</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
</dependency>
<!--Removed due to possible conflict with AWS SDK?-->
<!--<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
</dependency>-->
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.35</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
</dependency>
</dependencies>
Output of: mvn dependency:tree -Dverbose -Dincludes=com.amazonaws
com.trailfinder.restservice:TrailFinderRestService:war:1.0-SNAPSHOT
[INFO] \- com.amazonaws:aws-java-sdk-s3:jar:1.11.22:compile
[INFO] +- com.amazonaws:aws-java-sdk-kms:jar:1.11.22:compile
[INFO] | \- (com.amazonaws:aws-java-sdk-core:jar:1.11.22:compile - omitted for duplicate)
[INFO] \- com.amazonaws:aws-java-sdk-core:jar:1.11.22:compile

I think, I've found a solution / workaround to this issue. Thanks to suggestions from #DaveMaple I tried building the app through the command line and deploying the .war manually which seems to have worked.
According to this question IntelliJ IDEA uses its own build process and not Mavens. This leads me to believe that the issue was with IntelliJ's build process and nothing to do with AWS SDK or Maven. To work around this issue I configured IntelliJ to not use its own build process but instead to use Maven and then to deploy the resulting .war. Explanation on how to do this can be found here.

Related

Autogenerated code in amazon swf flow framework throws syntax error

I am trying our amazon's SWF flow framework, but I am getting the below error and the project does not compile. I am using maven for my dependency management and I'm running my code from Intellij.
[INFO] -------------------------------------------------------------
[ERROR] /home/meow/Arena/github/ProjectX/AWS/target/generated-sources/annotations/aws/swf/B_FlowFramework/B_WithAWSFlow/EditImageActivityClient.java:[24,18] <identifier> expected
[ERROR] /home/meow/Arena/github/ProjectX/AWS/target/generated-sources/annotations/aws/swf/B_FlowFramework/B_WithAWSFlow/EditImageActivityClient.java:[24,19] = expected
[ERROR] /home/meow/Arena/github/ProjectX/AWS/target/generated-sources/annotations/aws/swf/B_FlowFramework/B_WithAWSFlow/EditImageActivityClient.java:[24,25] illegal start of type
[ERROR] /home/meow/Arena/github/ProjectX/AWS/target/generated-sources/annotations/aws/swf/B_FlowFramework/B_WithAWSFlow/EditImageActivityClient.java:[29,18] <identifier> expected
[ERROR] /home/meow/Arena/github/ProjectX/AWS/target/generated-sources/annotations/aws/swf/B_FlowFramework/B_WithAWSFlow/EditImageActivityClient.java:[29,19] = expected
From Intellij, I've already confirmed if annotation processing is enabled from Settings -> Build, Execution,
Deployment -> Compiler -> Annotation Processors -> Enable
Annotation Processing
The codebase is on GitHub and its entry point is at https://github.com/vikkyhacks/ProjectX/blob/master/AWS/src/main/java/aws/swf/B_FlowFramework/B_WithAWSFlow/WorkflowStarter.java
Also adding pom.xml for easy reference,
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>vikkyhacks.projectX.aws</groupId>
<artifactId>AWS</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-swf-build-tools</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-dynamodb</artifactId>
<version>1.11.635</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-iam</artifactId>
<version>1.11.635</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-sqs</artifactId>
<version>1.11.635</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.10</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
It might be because you are using AWS SDK v1.11 and JDK 1.8. Did you try to upgrade AWS SDK to 2.0, or downgrade JDK to 1.6?
Check official documentation:
From SDK 1.1: https://github.com/aws/aws-sdk-java/blob/master/README.md
To run the SDK you will need Java 1.6+. For more information about the requirements and optimum settings for the SDK, please see the Installing a Java Development Environment section of the developer guide.
From SDK 2.0: https://github.com/aws/aws-sdk-java-v2/blob/master/README.md
To run the SDK you will need Java 1.8+. For more information about the requirements and optimum settings for the SDK, please see the Installing a Java Development Environment section of the developer guide.
Also, AWS recommends the BOM method for specifying/including individual modules:
Specifying Individual SDK Modules (Recommended)
To select individual SDK modules, use the AWS SDK for Java bill of materials (BOM) for Maven. This ensures that the modules you specify use the same version of the SDK, and that they're compatible with each other.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.X.X</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
And an example for Kinesis and DynamoDB:
<dependencies>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>kinesis</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>dynamodb</artifactId>
</dependency>
</dependencies>
Note: for SWF, try artifactId as swf. Full list: https://search.maven.org/search?q=g:software.amazon.awssdk

Unable to import any javax-servlet in Maven project in Netbeans

I am making a Maven project it is my first time with Maven. I'm using Netbeans and Tomcat server and I am not able to import any javax.servlet e.g. import javax.servlet.RequestDispatcher; etc. It looks like that:
There is info: javax.servlet does not exist and a solution proposed by Netbeans is for example: "Search Dependency at Maven Repository for javax.servlet.RequestDispatcher. When I click it then there is a pop-up window without anything to do:
I have the pom.xml file located in C://pathToNetbeansProjects/myProject/pom.xml
and I added a dependency for javax-servlet now my pom.xml looks like this:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.glassfish.jersey.archetypes</groupId>
<artifactId>ParkingSystem</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>ParkingSystem</name>
<build>
<finalName>ParkingSystem</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>${jersey.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<!-- use the following artifactId if you don't need servlet 2.x compatibility -->
<!-- artifactId>jersey-container-servlet</artifactId -->
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
</dependency>
<!-- uncomment this to get JSON support -->
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-binding</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<properties>
<jersey.version>2.27</jersey.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
I have no more ideas if I am doing something wrong with my pom.xml or maybe I need to do something in Netbeans to make it work. But I don't know really what.
The problem is 99% caused by a different import done by Maven on that library.
Maven imports your libs following a hierarchical manner, so probably there's some lib that you have imported that contains the javax.servlet, but it's not the version that you need.
First I suggest you to looking for which one is doing that for resolving the conflict by looking into maven hierarchy, you can achieve this with console command mvn dependency:tree -Dverbose ( look here for an example).
Then you can omit the unwanted libraries by a specific maven command inside your library:
<dependency>
....
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
This is an explanation useful for understanding "why" is happening this, so you can understand it.
Btw a quick fix, that you can try as first instance, is moving the import you wanted
javax.servlet as first element of your pom.
Force update your maven project or run
mvn clean install
on your project's directory to download all dependency of pom.xml. Build your project then and javax-servlet will be available.

Maven TinyB failure: package tinyb does not exist

I am trying to do a program where I need using Aws sdk and TinyB library. FOr that reason I have decided to use maven to create the project and resolve the dependencies. However, I have been trying to compile the project with the package TinyB for more than a week without success. I would be very grateful if someone could teach me what I am doing wrong.
The failure message I am receving is the following:
C:/Users/fran/Desktop/RSSI_AWS_PROJECT/BleDistanceMeasurement/src/main/java/org/tfm/app/BleMng.java:[7,1]
package tinyb does not exist
And my pom.xml is:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.tfm.app</groupId>
<artifactId>BleDistanceMeasurement</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>BleDistanceMeasurement</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.327</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-iot</artifactId>
<version>1.10.34</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-iot-device-sdk-java</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-iot-device-sdk-java-samples</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.kura</groupId>
<artifactId>tinyb</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>tinyb</id>
<url>https://repo.eclipse.org/content/groups/releases/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I have opened the project with Eclipse IDE to know what is happening but I have seen that eclipse is recognizing the dependencies correctly.
TinyB dependencie scan
Project dependencies
TinyB library I have downloaded and compiled the source from here:
https://github.com/intel-iot-devkit/tinyb
But there is no maven repositories directly from intel so I have added the one form eclipse kura:
<!-- https://mvnrepository.com/artifact/org.sputnikdev/bluetooth-manager-tinyb -->
<dependency>
<groupId>org.sputnikdev</groupId>
<artifactId>bluetooth-manager-tinyb</artifactId>
<version>1.0</version>
</dependency>
This one gives me problems when compiling, it seems as if the repository hasn't been downloaded. But the foder with the jar exists (it shows the error quoted previously).
I have made some little programs with TinyB and they are working perfectly, so the program is compiled and installed correctly. The problem is I am not using maven in this little programs (I just add the import and point to the .jar when executing). Like this:
sudo java -cp examples/java/HelloTinyB.jar:/usr/lib/lib/java/tinyb.jar HelloTinyB
I have also try this other maven repository:
<!-- https://mvnrepository.com/artifact/org.sputnikdev/bluetooth-manager-tinyb -->
<dependency>
<groupId>org.sputnikdev</groupId>
<artifactId>bluetooth-manager-tinyb</artifactId>
<version>1.3.2</version>
</dependency>
In this case it recognizes the dependencies and compiles. The problem is it gives error when I try to execute the program:
java.lang.RuntimeException: Native library is out of date. Please update the native library.
at tinyb.BluetoothManager.getBluetoothManager (BluetoothManager.java:317)
Thank you very much for your help.
I see you are trying to use eclipse Kura too.
Did you achieve making it work?
I have the same issue.
By the way, I see that maybe your dependencies are not really valid, as sputnikdev has a library over tinyB, but, finally I have the same problem than you. These are my main dependencies:
<!-- https://mvnrepository.com/artifact/org.sputnikdev/org.eclipse.smarthome.binding.bluetooth.transport.tinyb -->
<dependency>
<groupId>org.sputnikdev</groupId>
<artifactId>bluetooth-manager</artifactId>
<version>1.5.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/intel-iot-devkit/tinyb -->
<dependency>
<groupId>intel-iot-devkit</groupId>
<artifactId>tinyb</artifactId>
<version>0.5.1</version>
</dependency>
<dependency>
<groupId>org.sputnikdev</groupId>
<artifactId>bluetooth-manager-tinyb</artifactId>
<version>1.3.3</version>
</dependency>

Hibernate Error - Could not build ClassFile

So I am kind of at a dead end here. Have been troubleshooting for a half a day now. Using Hibernate JPA persistence in a Java application.
When running code from within IDE (IntelliJ 2018.1.5) it runs fine, however, when trying to run from jar via command line I get the following error (full stacktrace):
Exception in thread "main" org.hibernate.boot.archive.spi.ArchiveException: Could not build ClassFile
at org.hibernate.boot.archive.scan.spi.ClassFileArchiveEntryHandler.toClassFile(ClassFileArchiveEntryHandler.java:64)
at org.hibernate.boot.archive.scan.spi.ClassFileArchiveEntryHandler.handleEntry(ClassFileArchiveEntryHandler.java:47)
at org.hibernate.boot.archive.internal.JarFileBasedArchiveDescriptor.visitArchive(JarFileBasedArchiveDescriptor.java:147)
at org.hibernate.boot.archive.scan.spi.AbstractScannerImpl.scan(AbstractScannerImpl.java:47)
at org.hibernate.boot.model.process.internal.ScanningCoordinator.coordinateScan(ScanningCoordinator.java:75)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.prepare(MetadataBuildingProcess.java:98)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:228)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:170)
at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:76)
at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilder(HibernatePersistenceProvider.java:181)
at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(HibernatePersistenceProvider.java:129)
at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(HibernatePersistenceProvider.java:71)
at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:52)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)
at com.gsr.metrics.repository.BaseRepository.<init>(BaseRepository.java:10)
at com.gsr.metrics.repository.ProcessHistoryRepository.<init>(ProcessHistoryRepository.java:11)
at com.gsr.metrics.FileProcessor.<init>(FileProcessor.java:24)
at com.gsr.metrics.PostProcessor.run(PostProcessor.java:42)
at com.gsr.metrics.PostProcessor.main(PostProcessor.java:28) Caused by: java.io.IOException: invalid constant type: 19 at 5
at javassist.bytecode.ConstPool.readOne(ConstPool.java:1241)
at javassist.bytecode.ConstPool.read(ConstPool.java:1172)
at javassist.bytecode.ConstPool.<init>(ConstPool.java:185)
at javassist.bytecode.ClassFile.read(ClassFile.java:807)
at javassist.bytecode.ClassFile.<init>(ClassFile.java:148)
at org.hibernate.boot.archive.scan.spi.ClassFileArchiveEntryHandler.toClassFile(ClassFileArchiveEntryHandler.java:61)
... 19 more
Build configuration is Maven and this is the Hibernate dependency entry
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.gsr.metrics</groupId>
<artifactId>PostProcessor</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.gsr.metrics.PostProcessor</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.12.Final</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.27</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.197</version>
</dependency>
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>4.1</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.4</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>com.beust</groupId>
<artifactId>jcommander</artifactId>
<version>1.72</version>
</dependency>
</dependencies>
</project>
I've tried different Hibernate versions but in all cases have gotten the same error.
Problem occurs when this statement is executed
em = Persistence.createEntityManagerFactory(persistenceUnitName).createEntityManager();
I've stumbled upon the same problem and I found a similar solution.
I was using log4j-core 2.11.1 and got the same error when running the application from the jar. I've followed your solution and changed the verison to log4j-core 2.8.2.
After that I've still got an error, but this time it was a lack of dependeny: apparently it was missing one of the "com.fasterxml.jackson.core" package classes. So I've added the dependency (version 2.9.6) and now it's running.
Hope this helps some one because it was a very frustrating error.
After a great deal of trial and error I isolated the issue to some type of library conflict with log4j. Don't ask me what the exact problem was but changing the versions of one of the two made the problem go away. Did not have the time to perform any sort of detailed analysis on the underlying reason.

Unable to update snapshots or run the install goal with Maven

Does anyone have an idea how to resolve this Maven error? I get the following when I attempt to update my project's snapshots:
Build errors for my-projects-name;
org.apache.maven.lifecycle.LifecycleExecutionException:
Internal error in the plugin manager
executing goal
'org.apache.maven.plugins:maven-dependency-plugin:2.0:unpack':
Mojo execution failed.
And then when I try running "mvn install":
[INFO] [assembly:single {execution:default}] [INFO]
---------------------------------------------------------
[ERROR] BUILD ERROR [INFO]
---------------------------------------------------------
[INFO] Error reading assemblies: No assembly descriptors found.
I'm running Maven 2.1.0. Can anyone shed some light as to why it's balking at me? Other team members are able to perform the above actions with the exact same copy of the code from SVN.
Thanks!
Edit: Here's the POM:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.company.group</groupId>
<artifactId>the-project-parent</artifactId>
<version>1.0</version>
</parent>
<groupId>com.company.group.project</groupId>
<artifactId>project-root</artifactId>
<packaging>pom</packaging>
<name>Project Name</name>
<version>1.0.2-SNAPSHOT</version>
<description>This artifact contains the common settings for the Project.</description>
<url>http://maven.dev.companyName.com/sites/projectGroup/project</url>
<scm>
<connection>scm:svn:https://sourceforge.companyname.com/svn/repos/group/tags/projGroup/my-project-name</connection>
<developerConnection>scm:svn:https://sourceforge.companyname.com/svn/repos/group/tags/projGroup/my-project-name</developerConnection>
</scm>
<modules>
<module>module-1</module>
<module>module-2</module>
<module>module-3</module>
<module>module-4</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>net.sourceforge.jtds.jdbc</groupId>
<artifactId>jtds</artifactId>
<version>1.2.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.unitils</groupId>
<artifactId>unitils</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>2.3</version>
<scope>test</scope>
</dependency>
<!-- I cut most dependencies for brevity -->
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0-beta-5</version>
<inherited>false</inherited>
<configuration>
<preparationGoals>clean install</preparationGoals>
<tagBase>https://sourceforge.companyname.com/svn/repos/projects/tags/projGroup/my-project-name</tagBase>
</configuration>
</plugin>
</plugins>
</build>
</project>
You have no assembly plugin configuration shown in the pom you pasted. Perhaps it's in the parent? If there's no config then the assembly plugin will complain because you haven't configured it with a descriptor that tells it what to do. run mvn help:effective-pom and then paste those results (make sure to scrub any passwords) so I can see your full pom after inheritence.
I finally got it to run the install goal by downgrading Maven to 2.0.9.
EDIT:
I tried executing mvn clean install and mvn clean install assembly:assembly using Maven 2.1.0 and it duplicated the above error: > "No Assembly descriptors found."
It still works with Maven 2.0.9. I'm wholly convinced that at minimum something has changed between versions which is causing this this discrepancy...
EDIT:
From what I've been able to find out, it appears there's likely some kind of version conflict between Maven 2.1.0 and the version of this plugin we use:
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0-beta-5</version>

Categories