IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Plateformes (Java EE, Jakarta EE, Spring) et Serveurs Discussion :

Exporter un projet Spring boot vers jar executable


Sujet :

Plateformes (Java EE, Jakarta EE, Spring) et Serveurs

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éprouvé

    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2013
    Messages
    1 116
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Octobre 2013
    Messages : 1 116
    Par défaut Exporter un projet Spring boot vers jar executable
    Bonjour,

    Je souhaite exporter mon projet Spring boot vers un jar exécutable avec Eclipse, pour l'envoyer à des testeurs, et en attendant d'avoir une solution d'hébergement .

    J'ai fait
    - menu contextuel sur mon projet
    - puis exporter
    - j'ai pris l'option "runable jar file"
    - et j'ai choisi mon projet dans le wizard
    - puis finiish

    Il n'y a pas beaucoup d'options proposé.

    J'ai lancé le jar généré avec
    java -jar monprojet

    Et j'ai les erreurs suivants

    09:34:18.523 [main] DEBUG org.springframework.web.context.support.StandardServletEnvironment - Activating profiles []

    . ____ _ __ _ _
    /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
    ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
    \\/ ___)| |_)| | | | | || (_| | ) ) ) )
    ' |____| .__|_| |_|_| |_\__, | / / / /
    =========|_|==============|___/=/_/_/_/
    :: Spring Boot ::

    09:34:18.737 [main] INFO fr.repete.RepeteAvecMoi - Starting RepeteAvecMoi on DESKTOP-82FR04F with PID 14488 (P:\RepeteAvecMoi.jar started by Fabrice in P:\)
    09:34:18.737 [main] DEBUG fr.repete.RepeteAvecMoi - Running with Spring Boot, Spring
    09:34:18.737 [main] INFO fr.repete.RepeteAvecMoi - No active profile set, falling back to default profiles: default
    09:34:18.737 [main] DEBUG org.springframework.boot.SpringApplication - Loading source class fr.repete.RepeteAvecMoi
    09:34:18.794 [main] DEBUG org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext - Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@1c1bbc4e
    09:34:18.806 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
    09:34:18.862 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/P:/RepeteAvecMoi.jar!/fr/repete/configuration/WebSecurityConfig.class]
    09:34:18.870 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/P:/RepeteAvecMoi.jar!/fr/repete/general/MainController.class]
    09:34:18.873 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Ignored because not a concrete top-level class: URL [jar:file:/P:/RepeteAvecMoi.jar!/fr/repete/membre/MembreRepository.class]
    09:34:18.876 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/P:/RepeteAvecMoi.jar!/fr/repete/membre/MembreService.class]
    09:34:18.876 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/P:/RepeteAvecMoi.jar!/fr/repete/membre/MembreController.class]
    09:34:18.876 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/P:/RepeteAvecMoi.jar!/fr/repete/musique/MorceauService.class]
    09:34:18.883 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Ignored because not a concrete top-level class: URL [jar:file:/P:/RepeteAvecMoi.jar!/fr/repete/musique/MorceauRepository.class]
    09:34:18.885 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/P:/RepeteAvecMoi.jar!/fr/repete/musique/MorceauController.class]
    09:34:18.886 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Ignored because not a concrete top-level class: URL [jar:file:/P:/RepeteAvecMoi.jar!/fr/repete/musique/ArtisteRepository.class]
    09:34:18.887 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/P:/RepeteAvecMoi.jar!/fr/repete/musique/ArtisteController.class]
    09:34:18.888 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/P:/RepeteAvecMoi.jar!/fr/repete/musique/ArtisteService.class]
    09:34:18.889 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/P:/RepeteAvecMoi.jar!/fr/repete/repetition/RepetitionController.class]
    09:34:18.889 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/P:/RepeteAvecMoi.jar!/fr/repete/repetition/RepetitionService.class]
    09:34:18.891 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Ignored because not a concrete top-level class: URL [jar:file:/P:/RepeteAvecMoi.jar!/fr/repete/repetition/RepetitionRepository.class]
    09:34:18.933 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
    java.lang.IllegalArgumentException: No auto configuration classes found in META-INF/spring.factories. If you are using a custom packaging, make sure that file is correct.
    at org.springframework.util.Assert.notEmpty(Assert.java:464)
    at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.getCandidateConfigurations(AutoConfigurationImportSelector.java:173)
    at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.getAutoConfigurationEntry(AutoConfigurationImportSelector.java:116)
    at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector$AutoConfigurationGroup.process(AutoConfigurationImportSelector.java:396)
    at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGrouping.getImports(ConfigurationClassParser.java:878)
    at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.processGroupImports(ConfigurationClassParser.java:808)
    at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorHandler.process(ConfigurationClassParser.java:779)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:192)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:319)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:236)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
    at fr.repete.RepeteAvecMoi.main(RepeteAvecMoi.java:17)
    09:34:18.939 [main] DEBUG org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext - Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@1c1bbc4e, started on Wed Oct 07 09:34:18 CEST 2020
    J'ai cherché sur le web.
    J'ai trouvé des post sur des forums qui parle de construire le projet en ligne de commandes avec maven, mais la procédure n'est pas listée entièrement

    Cordialement
    Consultez mes articles sur l'accessibilité numérique :

    Comment rendre son application SWING accessible aux non voyants
    Créer des applications web accessibles à tous

    YES WE CAN BLANCHE !!!

    Rappelez-vous que Google est le plus grand aveugle d'Internet...
    Plus c'est accessible pour nous, plus c'est accessible pour lui,
    et meilleur sera votre score de référencement !

  2. #2
    Membre chevronné
    Homme Profil pro
    Architecte technique
    Inscrit en
    Mai 2020
    Messages
    348
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : Architecte technique

    Informations forums :
    Inscription : Mai 2020
    Messages : 348
    Par défaut
    Bonjour,

    Je n'ai pas d'expérience avec l'export d'Eclipse. Mais il me semble que Spring propose un plugin pour Gradle et Maven. Le plus sur serait certainement de se tourner vers ces plugins.

    D'après l'exception je dirais qu'il manque des dépendances dans votre Jar. Une solution serait de rechercher via Eclipse tous les jars qui contiennent des fichiers META-INF/spring.factories et de s'assurer qu'ils soient exportés eux aussi.

  3. #3
    Modérateur
    Avatar de wax78
    Homme Profil pro
    R&D - Palefrenier programmeur
    Inscrit en
    Août 2006
    Messages
    4 096
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : R&D - Palefrenier programmeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2006
    Messages : 4 096
    Par défaut
    Comme le fait remarquer Gervais, tu devrais utiliser Maven ou Graddle.

    De plus, si tu utilises ceci https://start.spring.io, tu auras un beau projet tout propre et prêt au release.
    (Les "ça ne marche pas", même écrits sans faute(s), vous porteront discrédit ad vitam æternam et malheur pendant 7 ans)

    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  4. #4
    Membre éprouvé

    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2013
    Messages
    1 116
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Octobre 2013
    Messages : 1 116
    Par défaut
    Merci de votre aide.

    Si il faut passer par maven en ligne de commande je vais le faire.
    J'ai essayé avec Eclipse, car d'habitude ça marchait pour d'autres types d'applications.

    Ce sont les informations que j'ai commencé à trouver sur le , mais il n'y avait pas toutes les étapeswebb.

    Faut-il modifier le pom ?
    Puis-je ajouter le plugin avec spring tools suite ?

    Cordialement
    Consultez mes articles sur l'accessibilité numérique :

    Comment rendre son application SWING accessible aux non voyants
    Créer des applications web accessibles à tous

    YES WE CAN BLANCHE !!!

    Rappelez-vous que Google est le plus grand aveugle d'Internet...
    Plus c'est accessible pour nous, plus c'est accessible pour lui,
    et meilleur sera votre score de référencement !

  5. #5
    Modérateur
    Avatar de wax78
    Homme Profil pro
    R&D - Palefrenier programmeur
    Inscrit en
    Août 2006
    Messages
    4 096
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : R&D - Palefrenier programmeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2006
    Messages : 4 096
    Par défaut
    Tu n'es pas obligé de passer par la ligne de commande (tu peux le faire cependant). Eclipse gère ça.

    Tu pourras modifier le pom si tu veux rajouter des dependances si tu ne l'as pas fait au début, mais il me semble pour avoir faire un petit test "Initializer" que le projet est prêt a être compilé et run sans problèmes.
    (Les "ça ne marche pas", même écrits sans faute(s), vous porteront discrédit ad vitam æternam et malheur pendant 7 ans)

    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  6. #6
    Membre éprouvé

    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2013
    Messages
    1 116
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Octobre 2013
    Messages : 1 116
    Par défaut
    Ok merci.
    Heureusement car mon Maven installé n'est pas à jour depuis un moment
    Le plugin Maven d'Eclipse doit l'être

    Alors je fais "run maven build" et je mets "package" dans le goal.

    Mais j'ai l'impression que je dois ajouter quelque chose dans le POM, un <plugin>, maven assembly.
    Je ne trouve pas d'exemple concret
    Consultez mes articles sur l'accessibilité numérique :

    Comment rendre son application SWING accessible aux non voyants
    Créer des applications web accessibles à tous

    YES WE CAN BLANCHE !!!

    Rappelez-vous que Google est le plus grand aveugle d'Internet...
    Plus c'est accessible pour nous, plus c'est accessible pour lui,
    et meilleur sera votre score de référencement !

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. exporter un projet android eclipse vers android studio
    Par mosbi dans le forum Mon application mobile
    Réponses: 1
    Dernier message: 04/08/2015, 11h12
  2. Problème création projet Spring Boot
    Par Copainbig dans le forum Spring Boot
    Réponses: 0
    Dernier message: 01/01/2015, 21h48
  3. Exporter un projet d'Eclipse vers Linux
    Par NFHnv dans le forum Eclipse Java
    Réponses: 2
    Dernier message: 25/10/2013, 15h03
  4. Réponses: 1
    Dernier message: 17/05/2013, 23h43
  5. Exportation de projet Java, classpath et jars
    Par kalash_jako dans le forum Général Java
    Réponses: 5
    Dernier message: 09/12/2008, 20h39

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo