they're used to gather information about the pages you visit and how many clicks you need to accomplish a task. they're used to log you in. 解决: 项目基于maven pom多模块的开发的,需要设置goal-repackage属性为true,否则打包后文件依赖文件没有一起打包,然后镜像内没有可以运行的程序文件. But in this case, since the file is from an application, i cannot do that. Since your are running an executable jar file, Java will look for the manifest MANIFEST.MF located under META-INF/ which contains information about the files packaged.. Java must know the main class to run. You can see an example of this at https://github.com/lagom/lagom-java-maven-chirper-example/blob/8a0c2b93b84512679eea1d94f2773f5bfa2b4d65/chirp-impl/pom.xml#L104-L119, In the future, please ask questions in the discussion forum at https://discuss.lagomframework.com/. Take time to understand ! Add to POM the following (no other changes): See Packaging Programs in JAR Files to learn how to create an executable JAR.. If it’s not an executable JAR, then you’ll need to run the program with something like: https://github.com/lagom/lagom-java-maven-chirper-example/blob/8a0c2b93b84512679eea1d94f2773f5bfa2b4d65/chirp-impl/pom.xml#L104-L119. no main manifest attribute, in "app.jar" Normally, if I had created the program myself, I would have added a main class attribute to the manifest file. mvn lagom:runAll can start all services successfully. privacy statement. For more information, see our Privacy Statement. By clicking “Sign up for GitHub”, you agree to our terms of service and If it is not able to find an entry,then it will complain with Unable to execute jar- file: “no main manifest attribute”.. MANIFEST.MF contains information about files contained in the Jar file. You signed in with another tab or window. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together. Problem: no main manifest attribute, in "APPLICATION_NAME.jar" no main manifest attribute, in /app.jar. Learn more, Docker run get "no main manifest attribute". Sign up for a free GitHub account to open an issue and contact its maintainers and the community. 2 comments Comments. This isn't the right way to build a Docker image for a Lagom service. Trying to use docker-maven-plugin to generate docker image. Sign in We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. You can always update your selection by clicking Cookie Preferences at the bottom of the page. Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world. Learn more, We use analytics cookies to understand how you use our websites so we can make them better, e.g. That should have been java -jar app.jar instead of java -jar "app".. This class is the one with the main method. Learn more. Download the official hello java maven sample code package. 提示没有入口类信息. This information was missing in the MANIFEST.MF.Below the content of this file before adding the maven-jar-plugin : com.spotify docker-maven-plugin 1.1.1 hello-world java ["java", "-jar", "/${project.build.finalName}.jar"] / ${project.build.directory} ${project.build.finalName}.jar , mvn clean package docker:build can build docker image successfully. Successfully merging a pull request may close this issue. to your account. Copy link Quote reply lwu08 commented Jul 25, 2018. Subham Mittal has worked in Oracle for 3 years . We use essential cookies to perform essential website functions, e.g. We’ll occasionally send you account related emails. We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. When you run self-executable jar, java will look for the Main-Class in MANIFEST.MF file located under META-INF folder. You need to set up the classpath and specify the main class in the entryPoint configuration. Download the official hello java maven sample code package. The -jar option only works if the JAR file is an executable JAR file, which means it must have a manifest file with a Main-Class attribute in it. In order to run the main method from our jar, we need to mention it inside the ‘Main-Class’ property of the manifest file (mainClass attribute in POM.xml in case of Mavenized application) which needs to be bundled with the code as well. "http://www.w3.org/2001/XMLSchema-instance", "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd", , , Fix no main manifest attribute, in jar Error in Spring Boot, no main manifest attribute, in Tutorial-0.0.1-SNAPSHOT.jar, Difference between Arraylist and Vector : Core Java Interview Collection Question, Amazon Interview Question : First Non repeated character in String, Count total number of times each alphabet appears in the string java program code with example, Java 8 new features : Lambda expressions , optional class , Defender methods with examples, Top 50 Java Collections Interview Questions and Answers, Java Multithreading Interview Questions and Answers.