How to override maven property in command line?

See Introduction to the POM finalName is created as: <build> <finalName>${project.artifactId}-${project.version}</finalName> </build> One of the solutions is to add own property: <properties> <finalName>${project.artifactId}-${project.version}</finalName> </properties> <build> <finalName>${finalName}</finalName> </build> And now try: mvn -DfinalName=build clean package

Valid JAR signature for JavaFX projects

I had a very similar problem; when I included a signed JAR (bouncycastle) in the project. Its signature was repackaged verbatim, resulting in an obvious SecurityException: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes Filtering of all sorts failed; the solution that works for me looks like this in the pom.xml: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> … Read more

How can I include test classes into Maven jar and execute them?

You should not access test classes from your application code, but rather create a main (the same main) in the test scope and create an additional artifact for your project. However, in this additional artifact (jar) you would need to have: The test classes The application code classes External dependencies required by application code (in … Read more

How to disable maven blocking external HTTP repositories?

I found a solution to do this by inspecting the commit in the Maven git repository that is responsible for the default HTTP blocking: https://github.com/apache/maven/commit/907d53ad3264718f66ff15e1363d76b07dd0c05f My solution is as follows: In the Maven settings (located in ${maven.home}/conf/settings.xml or ${user.home}/.m2/settings.xml), the following entry must be removed: <mirror> <id>maven-default-http-blocker</id> <mirrorOf>external:http:*</mirrorOf> <name>Pseudo repository to mirror external repositories initially … Read more

Maven Could not resolve dependencies, artifacts could not be resolved

Looks like you are missing some Maven repos. Ask for your friend’s .m2/settings.xml, and you’ll probably want to update the POM to include the repositories there. –edit: after some quick googling, try adding this to your POM: <repository> <id>com.springsource.repository.bundles.release</id> <name>SpringSource Enterprise Bundle Repository – SpringSource Bundle Releases</name> <url>http://repository.springsource.com/maven/bundles/release</url> </repository> <repository> <id>com.springsource.repository.bundles.external</id> <name>SpringSource Enterprise Bundle Repository … Read more

How to configure encoding in Maven?

OK, I have found the problem. I use some reporting plugins. In the documentation of the failsafe-maven-plugin I found, that the <encoding> configuration – of course – uses ${project.reporting.outputEncoding} by default. So I added the property as a child element of the project element and everything is fine now: <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> </properties> See also … Read more