Already on GitHub? If it’s not an executable JAR, then you’ll need to run the program with something like: Sign in 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.
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. Learn more. 提示没有入口类信息. Subham Mittal has worked in Oracle for 3 years . 2 comments Comments. mvn lagom:runAll can start all services successfully. Copy link Quote reply lwu08 commented Jul 25, 2018. 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".. no main manifest attribute, in /app.jar. You signed in with another tab or window. By clicking “Sign up for GitHub”, you agree to our terms of service and We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. Sign up for a free GitHub account to open an issue and contact its maintainers and the community. 解决: 项目基于maven pom多模块的开发的,需要设置goal-repackage属性为true,否则打包后文件依赖文件没有一起打包,然后镜像内没有可以运行的程序文件. Have a question about this project? 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. to your account. Download the official hello java maven sample code package. You need to set up the classpath and specify the main class in the entryPoint configuration. When you run self-executable jar, java will look for the Main-Class in MANIFEST.MF file located under META-INF folder. they're used to log you in. https://github.com/lagom/lagom-java-maven-chirper-example/blob/8a0c2b93b84512679eea1d94f2773f5bfa2b4d65/chirp-impl/pom.xml#L104-L119. You can always update your selection by clicking Cookie Preferences at the bottom of the page. they're used to gather information about the pages you visit and how many clicks you need to accomplish a task. privacy statement. Learn more, Docker run get "no main manifest attribute". Problem: no main manifest attribute, in "APPLICATION_NAME.jar" But in this case, since the file is from an application, i cannot do that. We use essential cookies to perform essential website functions, e.g. Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world. 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/. This isn't the right way to build a Docker image for a Lagom service. 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. See Packaging Programs in JAR Files to learn how to create an executable JAR.. Add to POM the following (no other changes): Trying to use docker-maven-plugin to generate docker image. For more information, see our Privacy Statement. We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. This information was missing in the MANIFEST.MF.Below the content of this file before adding the maven-jar-plugin : 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. Download the official hello java maven sample code package. This class is the one with the main method. "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. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together. 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. docker run -p 9000:9000 hello-world return error "no main manifest attribute, in /stream-impl-1.0-SNAPSHOT.jar". We’ll occasionally send you account related emails. Take time to understand !
.
Pak Choi Hackfleisch Low Carb,
Einhorn Malen Vorlage,
Hochzeitsmarsch Mendelssohn Klavier,
Maxwell 187 Größe,
Judi Dench Vogue,
Zeichnungen Drucken Lassen,