spring-guides / gs-maven Goto Github PK
View Code? Open in Web Editor NEWBuilding Java Projects with Maven :: Learn how to build a Java project with Maven.
Home Page: https://spring.io/guides/gs/maven/
License: Apache License 2.0
Building Java Projects with Maven :: Learn how to build a Java project with Maven.
Home Page: https://spring.io/guides/gs/maven/
License: Apache License 2.0
As described in this blog post, if you try to include a jarsigner
-signed dependency, you get a nasty "Invalid signature file digest for Manifest main attributes" stacktrace.
The blog above suggests adding the following snippet to the shade plugin <configuration>
section.
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
I'm new to Maven and Shade, so I'm not sure what the security implications of doing this are, but I thought I should suggest it. Thanks for writing the guide; i found it very useful.
Hello,
I'm working on this guide, but when I run mvn compile
I get the following error:
[ERROR] Source option 1.5 is no longer supported. Use 1.6 or later.
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.
I'm on OS X. mvn -v
shows:
Maven home: /Users/matthuntington/Desktop/apache-maven-3.5.0
Java version: 9, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac"
echo $JAVA_HOME
shows:
/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
echo $PATH
shows:
/Users/matthuntington/Desktop/apache-maven-3.5.0/bin/:/Users/matthuntington/.rbenv/bin:/Users/matthuntington/.rbenv/shims:/Users/matthuntington/anaconda/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
any suggestions? Thanks!
I was going through the tutorial Building Java Projects with Maven on https://spring.io/guides/gs/maven/. It mentions that after mvn compile
, target\classes
directory will be created, but that does not happen. I get this directory after mvn package
command and it only contains .jar files. Am I missing something?
OK . . . an obvious newb here . . . When I tried to enter this I was looking at a page about Spring LDAP. Now I come back and it seems to be filed under spring-guides/gs-maven. I don't know how that happened.
Until someone can give me a pointer on a tutorial for using this thing -- I'm going nowhere.
Following section 3.4 of the Spring LDAP Reference manual to use the DirContextAdapter and LdapTemplate for adding an attribute for a new user to a group, I get a MetaDataException thrown in the class ObjectMetaData (in the constructor) apparently because there are missing annotations in DirContextAdapter. I have all of this in a zip file with a README.txt, sample code, output, etc. but since this is the first bug I have ever reported, I don't have a clue as to how to provide this.
Figured this one our myself.
Was getting the following error when using mvn package
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.6:jar (default-jar) on
project gs-spring-boot: Execution default-jar of goal org.apache.maven.plugins:maven-jar-
plugin:2.6:jar failed: An API incompatibility was encountered while executing
org.apache.maven.plugins:maven-jar-plugin:2.6:jar: java.lang.ExceptionInInitializerError: null
I don't know exactly what caused it to be looking for an apparently incompatible version of the maven-jar-plugin-2.6.jar
however simply adding the following under plugins in pom.xml fixed the issue.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.0</version>
</plugin>
When I am trying to run the project using java -jar target/gs-maven-0.1.0.jar I am getting the error:
no main manifest attribute, in target/gs-maven-0.1.0.jar.
Is there something I'm missing?
Hi I am new to contributing thank you all for building this Spring tutorial!
I had issues with knowing how to run the executable jar file. After some research I found that running java -jar target/gs-maven-0.1.0.jar
in the terminal worked.
I figured this could be useful to add to the guide for newer developers.
Hi there,
Minor issue: In this section of the tutorial: https://github.com/spring-guides/gs-maven/blob/master/README.adoc#declare-dependencies, the part about inserting a <dependency> element doesn't mention putting it in a <dependencies> element as well.
Thanks,
Andrew
While working through the tutorial a section of xml code for build appears in the complete pom.xml but it is not explained prior.
Please let me know if you okay with this i can contribute some code ๐จโ๐ป
The audience of this guide is programmers new to maven. The shade plugin is used in the final pom without giving any explanation. While I understand that details of the plugin is outside the scope of the guide, a simple one liner could be added why it is there (like: a maven plugin 'shade' is used to specify the main class for jar execution).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.