Partage
  • Partager sur Facebook
  • Partager sur Twitter

Dépendance Maven

Sujet résolu
    16 mars 2022 à 19:08:38

    Bonjour,

    Je rencontre un problème que je n'arrive pas à solutionner !

    Je suis occuper à migrer mes projets JEE vers Maven. J'ai créer un module EAR, EJB et JAR. Dans le module JAR, il y a que des classes parents, abstraites et des inferfaces. Par conséquent, beaucoup de mes classes de mon EJB hérite donc des classes se trouvant dans mon module JAR. Actuellement, j'arrive à compiler mon fichier .EAR et le faire fonctionner sur un server Wildfly. Donc j'en déduis que la partie "<Build>" de mes pom.xml est bien écrites. Mais pour le faire fonctionner, je suis obligé de déplacer manuellement mon fichier EAR vers mon dossier de déploiement de Wildfly. Ce qui est très ennuyant en mode développement. Normalement dans Eclipse, je glisse une seule fois mon projet EAR vers le serveur. Et tout ce remets à jour lorsque j'effectue des modifications. Mais dans mon cas, impossible de démarrer Wildfly avec mon projet de mon Workspace. Il m'indique toujours une bibliothèque manquante. Alors qu'est pourtant bien implanté ! Je ne comprends pas !

    <project xmlns="http://maven.apache.org/POM/4.0.0"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    	<modelVersion>4.0.0</modelVersion>
    
    	<groupId>EAR-Project7</groupId>
    	<artifactId>EAR-Project7</artifactId>
    	<version>0.0.1-SNAPSHOT</version>
    	<packaging>ear</packaging>
    	<name>EAR-Project7</name>
    
    	<properties>
    		<version.server.bom>18.0.1.Final</version.server.bom>
    	</properties>
    
    	<dependencyManagement>
    		<dependencies>
    			<dependency>
    				<groupId>org.wildfly.bom</groupId>
    				<artifactId>wildfly-jakartaee8-with-tools</artifactId>
    				<version>${version.server.bom}</version>
    				<type>pom</type>
    				<scope>import</scope>
    			</dependency>
    		</dependencies>
    	</dependencyManagement>
    
    	<dependencies>
    		<dependency>
    			<groupId>org.jboss.spec.javax.annotation</groupId>
    			<artifactId>jboss-annotations-api_1.3_spec</artifactId>
    			<scope>provided</scope>
    		</dependency>
    		<dependency>
    			<groupId>org.jboss.spec.javax.ejb</groupId>
    			<artifactId>jboss-ejb-api_3.2_spec</artifactId>
    			<scope>provided</scope>
    		</dependency>
    		<dependency>
    			<groupId>EJB-Core</groupId>
    			<artifactId>EJB-Core</artifactId>
    			<version>0.0.1-SNAPSHOT</version>
    		</dependency>
    		<dependency>
    			<groupId>EJB-Project7</groupId>
    			<artifactId>EJB-Project7</artifactId>
    			<version>0.0.1-SNAPSHOT</version>
    			<type>ejb</type>
    		</dependency>
    	</dependencies>
    
    	<build>
    		<plugins>
    			<plugin>
    				<groupId>org.apache.maven.plugins</groupId>
    				<artifactId>maven-ear-plugin</artifactId>
    				<version>3.2.0</version>
    				<configuration>
    					<finalName>EAR-Project7</finalName>
    					<modules>
    						<jarModule>
    							<groupId>EJB-Core</groupId>
    							<artifactId>EJB-Core</artifactId>
    							<bundleDir>/</bundleDir>
    							<bundleFileName>EJB-Core</bundleFileName>
    						</jarModule>
    						<ejbModule>
    							<groupId>EJB-Project7</groupId>
    							<artifactId>EJB-Project7</artifactId>
    							<bundleFileName>EJB-Project7</bundleFileName>
    						</ejbModule>
    					</modules>
    				</configuration>
    			</plugin>
    		</plugins>
    	</build>
    
    </project>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    	<modelVersion>4.0.0</modelVersion>
    	
    	<groupId>EJB-Project7</groupId>
    	<artifactId>EJB-Project7</artifactId>
    	<version>0.0.1-SNAPSHOT</version>
    	<packaging>ejb</packaging>
    	<name>EJB-Project7</name>
    	
    	<dependencies>
    		<dependency>
    			<groupId>javax</groupId>
    			<artifactId>javaee-api</artifactId>
    			<version>7.0</version>
    			<scope>provided</scope>
    		</dependency>
    		<dependency>
    			<groupId>org.projectlombok</groupId>
    			<artifactId>lombok</artifactId>
    			<version>1.18.20</version>
    			<scope>provided</scope>
    		</dependency>
    		<dependency>
    			<groupId>EJB-Core</groupId>
    			<artifactId>EJB-Core</artifactId>
    			<version>0.0.1-SNAPSHOT</version>
    		</dependency>
    	</dependencies>
    	
    	<build>
    		<pluginManagement>
    			<plugins>
    				<plugin>
    					<groupId>org.apache.maven.plugins</groupId>
    					<artifactId>maven-compiler-plugin</artifactId>
    					<version>3.8.1</version>
    					<configuration>
    						<source>1.8</source>
    						<target>1.8</target>
    					</configuration>
    				</plugin>
    				<plugin>
    					<artifactId>maven-ejb-plugin</artifactId>
    					<version>2.5</version>
    					<configuration>
    						<ejbVersion>3.2</ejbVersion>
    					</configuration>
    				</plugin>
    			</plugins>
    		</pluginManagement>
    
    		<resources>
    			<resource>
    				<directory>src/main/resources</directory>
    			</resource>
    		</resources>
    	</build>
    
    </project>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      
      <groupId>EJB-Core</groupId>
      <artifactId>EJB-Core</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>jar</packaging>
      <name>EJB-Core</name>
    	
      <dependencies>
    		<dependency>
    			<groupId>org.openjfx</groupId>
    			<artifactId>javafx-controls</artifactId>
    			<version>15.0.1</version>
    		</dependency>
    		<dependency>
    			<groupId>javax</groupId>
    			<artifactId>javaee-api</artifactId>
    			<version>7.0</version>
    			<scope>provided</scope>
    		</dependency>
    		<dependency>
    			<groupId>net.sf.jasperreports</groupId>
    			<artifactId>jasperreports</artifactId>
    			<version>6.17.0</version>
    		</dependency>
    		<dependency>
    			<groupId>com.googlecode.libphonenumber</groupId>
    			<artifactId>libphonenumber</artifactId>
    			<version>7.0</version>
    		</dependency>
    		<dependency>
    			<groupId>org.projectlombok</groupId>
    			<artifactId>lombok</artifactId>
    			<version>1.18.20</version>
    			<scope>provided</scope>
    		</dependency>
    		<dependency>
    			<groupId>com.jcraft</groupId>
    			<artifactId>jsch</artifactId>
    			<version>0.1.54</version>
    		</dependency>
    		<dependency>
    			<groupId>org.apache.commons</groupId>
    			<artifactId>commons-lang3</artifactId>
    			<version>3.9</version>
    		</dependency>
    		<dependency>
    			<groupId>org.controlsfx</groupId>
    			<artifactId>controlsfx</artifactId>
    			<version>8.40.14</version>
    		</dependency>
    		<dependency>
    			<groupId>commons-digester</groupId>
    			<artifactId>commons-digester</artifactId>
    			<version>2.1</version>
    		</dependency>
    		<dependency>
    			<groupId>commons-net</groupId>
    			<artifactId>commons-net</artifactId>
    			<version>3.6</version>
    		</dependency>
    		<dependency>
    			<groupId>jakarta.validation</groupId>
    			<artifactId>jakarta.validation-api</artifactId>
    			<version>2.0.2</version>
    		</dependency>
    		<dependency>
    			<groupId>org.hibernate</groupId>
    			<artifactId>hibernate-core</artifactId>
    			<version>5.3.13.Final</version>
    		</dependency>
    		<dependency>
    			<groupId>org.hibernate</groupId>
    			<artifactId>hibernate-entitymanager</artifactId>
    			<version>5.3.13.Final</version>
    		</dependency>
    		<dependency>
    			<groupId>org.hibernate</groupId>
    			<artifactId>hibernate-envers</artifactId>
    			<version>5.3.13.Final</version>
    		</dependency>
    		<dependency>
    			<groupId>org.hibernate</groupId>
    			<artifactId>hibernate-java8</artifactId>
    			<version>5.3.13.Final</version>
    		</dependency>
    	</dependencies>
    
    	<build>
    		<pluginManagement>
    			<plugins>
    				<plugin>
    					<groupId>org.apache.maven.plugins</groupId>
    					<artifactId>maven-compiler-plugin</artifactId>
    					<version>3.8.1</version>
    					<configuration>
    						<source>1.8</source>
    						<target>1.8</target>
    					</configuration>
    				</plugin>
    			</plugins>
    		</pluginManagement>
    
    		<resources>
    			<resource>
    				<directory>src/main/resources</directory>
    			</resource>
    		</resources>
    	</build>
    	
    </project>



    Est ce que quelqu'un pourrait m'aider ?

    Merci d'avance

    -
    Edité par Mmmuzik 16 mars 2022 à 19:10:09

    • Partager sur Facebook
    • Partager sur Twitter
      17 mars 2022 à 19:51:55

      J'ai trouvé ! Pour ceux que ça intéresse, il faut ajouter la ligne : "<includeInApplicationXml>true</includeInApplicationXml>" dans le pom.xml du project EAR.

      Soit : 

      <build>
      		<plugins>
      			<plugin>
      				<groupId>org.apache.maven.plugins</groupId>
      				<artifactId>maven-ear-plugin</artifactId>
      				<version>3.2.0</version>
      				<configuration>
      					<finalName>EAR-Project7B</finalName>
      					<modules>
      						<jarModule>
      							<groupId>EJB-Core</groupId>
      							<artifactId>EJB-Core</artifactId>
      							<bundleDir>/</bundleDir>
      							<bundleFileName>EJB-Core</bundleFileName>
      							<includeInApplicationXml>true</includeInApplicationXml>
      						</jarModule>
      						<ejbModule>
      							<groupId>EJB-Project7</groupId>
      							<artifactId>EJB-Project7</artifactId>
      							<bundleFileName>EJB-Project7</bundleFileName>
      						</ejbModule>
      					</modules>
      				</configuration>
      			</plugin>
      		</plugins>
      	</build>



      • Partager sur Facebook
      • Partager sur Twitter

      Dépendance Maven

      × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
      × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
      • Editeur
      • Markdown