Integrated an maven project to an existing maven project - java

I have a existing db Maven Java project in eclipse. And the second is also in Maven project with a global pom and subdirectory pom. What is the easiest way to integrate both projects into one project ? I tried to add these subfolders with the pom file. But i got the failure modules is an invalid element. Maybe there is another way to add the second project. The first project is an embedded neo4j db and the seconde project is the jung frame work. Which has also sub pom files.
<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>DB</groupId>
<artifactId>DB</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>db-suche</groupId>
<artifactId>db-suche</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>com.github.tomnelson</groupId>
<artifactId>jungrapht-visualization-parent</artifactId>
<version>1.4-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JunGrapht Visualization</name>
<description>Jungrapht-visualization is a port of the Java Universal Network Graph (JUNG)
visualization and sample code that uses JGrapht graph models and algorithms.</description>
<url>http://tomnelson.github.io/jungraphtvisualization/</url>
<licenses>
<license>
<name>The BSD License</name>
<url>https://github.com/tomnelson/jungrapht/blob/master/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>tomnelson</id>
<name>Tom</name>
<email>tomnelson#users.noreply.github.com</email>
<organization>WrenchIO</organization>
<organizationUrl>https://wrench.io/</organizationUrl>
<roles>
<role>Owner</role>
<role>Developer</role>
</roles>
<timezone>-5</timezone>
</developer>
</developers>
<prerequisites>
<maven>3.1.1</maven>
</prerequisites>
<modules>
<module>jungrapht-visualization</module>
<module>jungrapht-layout</module>
<module>jungrapht-visualization-samples</module>
</modules>
<scm>
<connection>scm:git:git://github.com/tomnelson/jungrapht.git</connection>
<developerConnection>scm:git:git://github.com/tomnelson/jungrapht.git</developerConnection>
<url>https://github.com/tomnelson/jungrapht</url>
</scm>
<distributionManagement>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<properties>
<cobertura.plugin.version>2.7</cobertura.plugin.version>
<compiler.plugin.version>3.8.0</compiler.plugin.version>
<doclint>none</doclint>
<fmt.plugin.version>1.8.0</fmt.plugin.version>
<google-java-format.version>1.3</google-java-format.version>
<gpg.plugin.version>1.6</gpg.plugin.version>
<jar.plugin.version>2.6</jar.plugin.version>
<java.version>11</java.version>
<javadoc.plugin.version>3.1.0</javadoc.plugin.version>
<jgrapht.version>1.5.1</jgrapht.version>
<junit.version>4.13.1</junit.version>
<jxr.plugin.version>2.5</jxr.plugin.version>
<pmd.plugin.version>3.12.0</pmd.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<release.plugin.version>2.5.3</release.plugin.version>
<source.plugin.version>3.0.1</source.plugin.version>
<surefire.plugin.version>2.19.1</surefire.plugin.version>
<version.logback>1.2.10</version.logback>
<version.slf4j>1.7.32</version.slf4j>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.jgrapht</groupId>
<artifactId>jgrapht-core</artifactId>
<version>${jgrapht.version}</version>
</dependency>
<dependency>
<groupId>org.jgrapht</groupId>
<artifactId>jgrapht-guava</artifactId>
<version>${jgrapht.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<defaultGoal>clean verify</defaultGoal>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.github.ekryd.sortpom</groupId>
<artifactId>sortpom-maven-plugin</artifactId>
<version>2.4.0</version>
<executions>
<execution>
<id>sort-pom</id>
<goals>
<goal>sort</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
<createBackupFile>false</createBackupFile>
<lineSeparator>\n</lineSeparator>
<expandEmptyElements>false</expandEmptyElements>
<nrOfIndentSpace>4</nrOfIndentSpace>
<sortDependencies>scope,groupId,artifactId</sortDependencies>
<sortPlugins>groupId,artifactId</sortPlugins>
<sortProperties>true</sortProperties>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler.plugin.version}</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>${release.plugin.version}</version>
<configuration>
<mavenExecutorId>forked-path</mavenExecutorId>
<useReleaseProfile>false</useReleaseProfile>
<arguments>${arguments} -Psonatype-oss-release</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.8.2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>${fmt.plugin.version}</version>
<dependencies>
<dependency>
<groupId>com.google.googlejavaformat</groupId>
<artifactId>google-java-format</artifactId>
<version>${google-java-format.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.ekryd.sortpom</groupId>
<artifactId>sortpom-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<!-- generates aggregated javadoc for root project -->
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc.plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-jxr-plugin</artifactId>
<version>${jxr.plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-pmd-plugin</artifactId>
<version>${pmd.plugin.version}</version>
<configuration>
<targetJdk>${java.version}</targetJdk>
<linkXref>true</linkXref>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>${surefire.plugin.version}</version>
</plugin>
</plugins>
</reporting>
<profiles>
<profile>
<id>sonatype-oss-release</id>
<build>
<plugins>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>${gpg.plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<goals>
<goal>sign</goal>
</goals>
<phase>verify</phase>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc.plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>${source.plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

Related

How to deploy a multi module project to Artifactory

I want to deploy a "toolbox" to Artifactory with Maven. It's essentially a multi module project.
The goal is to deploy the toolbox, and pull it from another projects, either the separate tools or the whole toolbox. For example:
toolbox project name: `backend-tools`
tools: `mail`
and I want to pull it from another project like this:
<dependency>
<groupId>com.example</groupId>
<artifactId>backend-tools</artifactId>
<version>1.17</version>
</dependency>
Alternatively, I want, that you can pull the individual projects like this:
<dependency>
<groupId>com.example</groupId>
<artifactId>mail</artifactId>
<version>1.1</version>
</dependency>
When I pull the project the following error appears:
Could not find artifact com.example.itlab:backend-tools:pom:v0.0.1 in artifactory ({{{artifactory link}}})
my current setup:
pom.xml (mail)
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<parent>
<groupId>com.example</groupId>
<artifactId>backend-tools</artifactId>
<version>1.2</version>
</parent>
<groupId>com.example</groupId>
<artifactId>mail</artifactId>
<version>1.1</version>
<dependencies>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>log4j2.xml</exclude>
<exclude>*.yml</exclude>
<exclude>*.mailprops.json</exclude>
<exclude>*_instance.properties</exclude>
</excludes>
</resource>
</resources>
<finalName>${project.artifactId}-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<excludes>
<exclude>com.example.mail.Main</exclude>
</excludes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<trimStackTrace>false</trimStackTrace>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
pom.xml (backend-tools)
<modelVersion>4.0.0</modelVersion>
<modules>
<module>mail</module>
</modules>
<organization>
<name><!-- ORGANISATION NAME --></name>
<url><!-- ORGANISATION URL --></url>
</organization>
<developers>
<developer>
<name><!-- DEV NAME--></name>
<roles>
<role>Developer</role>
</roles>
<email><!-- DEV EMAIL --></email>
</developer>
</developers>
<groupId>com.example.itlab</groupId>
<artifactId>backend-tools</artifactId>
<version>1.2</version>
<name>backend-tools</name>
<description>All Tools for the Backend</description>
<packaging>pom</packaging>
<properties>
<mail.version>1.4.7</mail.version>
</properties>
<distributionManagement>
<repository>
<id>release</id>
<name>Artifactory-Primary-snapshots</name>
<url><!-- <ARTIFACTORY LINK> --></url>
</repository>
<snapshotRepository>
<id>snapshot</id>
<uniqueVersion>true</uniqueVersion>
<url><!-- <ARTIFACTORY LINK> --></url>
</snapshotRepository>
</distributionManagement>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>${mail.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<trimStackTrace>false</trimStackTrace>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<outputDirectory>../target</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<configuration>
<doclint>-html,-syntax,-accessibility,-missing</doclint>
<failOnError>false</failOnError>
<quiet>true</quiet>
<reportOutputDirectory>${project.build.directory}</reportOutputDirectory>
</configuration>
<executions>
<execution>
<phase>generate-resources</phase>
<id>attach-javadocs</id>
<goals>
<goal>javadoc</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

java.lang.NoClassDefFoundError when jndi lookup for API

I am having a NoClassDefFoundError exception when I execute a jndi lookup for an API in an EJB. Here is what my project looks like :
java project
In my project I have 2 APIs, 2 EJBs and 2 Clients. Both my clients work. What I am trying to do is make a function of EJB ejb-admin-bean call ejb-31-entity-bean-exemple-bean by calling ejb-31-entity-bean-exemple-api.
Here is the code that :
package admin.entity_bean_ejb;
import javax.ejb.Stateless;
import javax.naming.InitialContext;
import admin.entity_bean_api.StatelessSessionAdmin;
import enterprise.entity_bean_api.StatelessSessionLocal;
/**
* The stateless session bean.
*/
#Stateless
public class StatelessSessionAdminBean implements StatelessSessionAdmin {
#Override
public String helloWorld() {
return "the room is called " + getShowRoomName();
}
//test d'appel de l'api d'encheres
public String getShowRoomName() {
StatelessSessionLocal sb;
try {
InitialContext ic = new InitialContext();
sb = (StatelessSessionLocal) ic.lookup("java:global/ejb-31-entity-bean-example-bean/StatelessSessionBean!enterprise.entity_bean_api.StatelessSessionLocal");
final String roomName = sb.getShowRoomName(1);
return roomName;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
The class not found is StatelessSessionLocal from ejb-31-entity-bean-example-api
Here is the stackTrace :
javax.ejb.EJBException
at com.sun.ejb.containers.EJBContainerTransactionManager.processSystemException(EJBContainerTransactionManager.java:752)
Caused by: java.lang.ClassNotFoundException: enterprise.entity_bean_api.StatelessSessionLocal
at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:865)
at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:742)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 52 more
I use Eclipse, glassfish and maven. Here are the POMs of my project :
Here is the parent pom :
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.glassfish-samples</groupId>
<artifactId>ejb-31-entity-bean-example</artifactId>
<packaging>pom</packaging>
<name>ejb-31-entity-bean-example</name>
<version>4.0-SNAPSHOT</version>
<!-- repositories for the checkstyle configuration TSP CSC -->
<pluginRepositories>
<pluginRepository>
<id>tsp-csc-checkstyle-config-stable</id>
<name>TSP CSC Checkstyle configuration, stable</name>
<url>http://www-inf.telecom-sudparis.eu/COURS/CSC4102/maven-repository/stable/</url>
</pluginRepository>
<pluginRepository>
<id>tsp-csc-checkstyle-config-snapshot</id>
<name>TSP CSC Checkstyle configuration, snapshot</name>
<url>http://www-inf.telecom-sudparis.eu/COURS/CSC4102/maven-repository/snapshot/</url>
</pluginRepository>
</pluginRepositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<glassfish.version>4.1</glassfish.version>
</properties>
<build>
<plugins>
<!-- maven-eclipse configuration -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.10</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<!-- java compiler configuration -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- surefire configuration -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<enableAssertions>true</enableAssertions>
<reuseForks>false</reuseForks>
</configuration>
</plugin>
<!-- source packaging configuration -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- javadoc packaging in jar configuration -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<docfilessubdirs>true</docfilessubdirs>
<detectOfflineLinks>false</detectOfflineLinks>
<detectJavaApiLink>false</detectJavaApiLink>
</configuration>
</execution>
</executions>
</plugin>
<!-- checkstyle configuration -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>eu.telecomsudparis.csc</groupId>
<artifactId>tsp-csc-config-checkstyle</artifactId>
<version>1.1-SNAPSHOT</version>
</dependency>
</dependencies>
<configuration>
<checkstyle.config.location>config/checkstyle/sun_checks_adapted_to_tsp_csc.xml</checkstyle.config.location>
<configLocation>config/checkstyle/sun_checks_adapted_to_tsp_csc.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>false</failsOnError>
<linkXRef>false</linkXRef>
</configuration>
</plugin>
<!-- site configuration -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.6</version>
<configuration>
<locales>fr</locales>
</configuration>
</plugin>
</plugins>
</build>
<!-- reports in the maven site -->
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.4</version>
<configuration>
<dependencyDetailsEnabled>false</dependencyDetailsEnabled>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<configuration>
<configLocation>config/checkstyle/sun_checks_adapted_to_tsp_csc.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>false</failsOnError>
<linkXRef>false</linkXRef>
</configuration>
</plugin>
</plugins>
</reporting>
<modules>
<module>ejb-31-entity-bean-example-entity</module>
<module>ejb-31-entity-bean-example-api</module>
<module>ejb-31-entity-bean-example-bean</module>
<module>ejb-31-entity-bean-example-client</module>
<module>ejb-admin-bean</module>
<module>ejb-admin-api</module>
<module>ejb-admin-entity</module>
<module>ejb-admin-client</module>
</modules>
</project>
And here is the POM of the bean that wants to call the api :
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.glassfish-samples</groupId>
<artifactId>ejb-31-entity-bean-example</artifactId>
<version>4.0-SNAPSHOT</version>
</parent>
<groupId>org.glassfish-samples.entity-bean-example2</groupId>
<artifactId>ejb-admin-bean</artifactId>
<packaging>ejb</packaging>
<name>The EJB 3.2 Entity Bean Sample Application</name>
<version>4.0-SNAPSHOT</version>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-shade-plugin -->
<!-- <dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
</dependency>
-->
<dependency>
<groupId>org.glassfish-samples.entity-bean-example2</groupId>
<artifactId>ejb-admin-entity</artifactId>
<version>4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.glassfish-samples.entity-bean-example2</groupId>
<artifactId>ejb-admin-api</artifactId>
<version>4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
</dependency>
<!-- embedded glassfish for JUnit tests -->
<dependency>
<groupId>org.glassfish.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>3.1.1</version>
<scope>test</scope>
</dependency>
<!-- JUnit tests -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!--interaction entre les modules de l'appli. ajout perso-->
<dependency>
<groupId>org.glassfish-samples.entity-bean-example</groupId>
<artifactId>ejb-31-entity-bean-example-api</artifactId>
<version>4.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>entity-bean2</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>unpack</id>
<phase>process-classes</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.glassfish-samples.entity-bean-example2</groupId>
<artifactId>ejb-admin-entity</artifactId>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.glassfish-samples.entity-bean-example2</groupId>
<artifactId>ejb-admin-api</artifactId>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- build the ejb jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<jarName>entity-bean2</jarName>
<ejbVersion>3.2</ejbVersion>
</configuration>
</plugin>
</plugins>
</build>
</project>
Thank you for your help!

Maven Compilation FAILURE - java.lang.ClassNotFoundException

I have a problem i want to custom my BungeeCord for my server but when i build the project have a big problem.
The maven log: https://pastebin.com/raw/Y2ppUL3d
My Main POM.xml
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-parent</artifactId>
<version>1.12-SNAPSHOT</version>
<packaging>pom</packaging>
<name>BungeeCord-Parent</name>
<description>Parent project for all BungeeCord modules.</description>
<url>https://github.com/SpigotMC/BungeeCord</url>
<inceptionYear>2012</inceptionYear>
<organization>
<name>SpigotMC</name>
<url>https://github.com/SpigotMC</url>
</organization>
<licenses>
<license>
<name>The BSD 3-Clause License</name>
<url>http://opensource.org/licenses/BSD-3-Clause</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>md_5</id>
</developer>
</developers>
<modules>
<module>api</module>
<module>bootstrap</module>
<module>chat</module>
<module>config</module>
<module>event</module>
<module>log</module>
<module>module</module>
<module>protocol</module>
<module>proxy</module>
<module>query</module>
<module>native</module>
</modules>
<scm>
<connection>scm:git:git#github.com:SpigotMC/BungeeCord.git</connection>
<developerConnection>scm:git:git#github.com:SpigotMC/BungeeCord.git</developerConnection>
<url>git#github.com:SpigotMC/BungeeCord.git</url>
</scm>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/SpigotMC/BungeeCord/issues</url>
</issueManagement>
<ciManagement>
<system>jenkins</system>
<url>http://ci.md-5.net/job/BungeeCord</url>
</ciManagement>
<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<properties>
<build.number>unknown</build.number>
<netty.version>4.1.21.Final</netty.version>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>20.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>findbugs-annotations</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.16</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>scriptus</artifactId>
<version>0.3.1</version>
<configuration>
<format>git:${project.name}:${project.version}:%s:${build.number}</format>
</configuration>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>describe</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.16</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java17</artifactId>
<version>1.0</version>
</signature>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>net.md-5</groupId>
<artifactId>scriptus</artifactId>
<versionRange>[0.3.1,)</versionRange>
<goals>
<goal>describe</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>false</runOnIncremental>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
And here is the pom of the module bungeecord-boostrap
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-parent</artifactId>
<version>1.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-bootstrap</artifactId>
<version>1.12-SNAPSHOT</version>
<packaging>jar</packaging>
<name>BungeeCord-Bootstrap</name>
<description>Java 1.6 loader for BungeeCord</description>
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<maven.build.timestamp.format>yyyyMMdd</maven.build.timestamp.format>
</properties>
<dependencies>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-proxy</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.sf.jopt-simple</groupId>
<artifactId>jopt-simple</artifactId>
<version>4.9</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>BungeeCord</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifestEntries>
<Main-Class>net.md_5.bungee.Bootstrap</Main-Class>
<Implementation-Version>${describe}</Implementation-Version>
<Specification-Version>${maven.build.timestamp}</Specification-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>**/*.java</exclude>
<exclude>**/*.SF</exclude>
<exclude>**/*.DSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</plugin>
</plugins>
</build>
</project>
I tried everything but nothing works, yet the class that works is well in the dependencies, I do not understand ...

Maven shade plugin not relocating

I've been trying to shade a package from one jar into my own and when I build the project using IntelliJ, it does not shade it in. I've been trying different things from online for over an hour and I thought it would be much simpler to ask on here. I have Maven 3.5.0 installed (mvn -version returns the proper version) and I can see the jar I'm trying to shade in the repositories directory.
My pom.xml:
<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
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mccraftaholics</groupId>
<artifactId>WarpPortals</artifactId>
<version>5.6.5-SNAPSHOT</version>
<packaging>jar</packaging>
<name>WarpPortals</name>
<url>http://alexwendland.com</url>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>bstats-repo</id>
<url>http://repo.bstats.org/content/repositories/releases/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.12-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>1.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.5</version>
<configuration>
<artifactSet>
<includes>
<include>org.bstats:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>com.mccraftaholics.warpportals</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

I have an error in pom.xml file

I got an error that is shown in picture
you can see error in the picture that i given this error comes at line where i write a packaging tag when i remove this tag then error come at this point (http://maven.apache.org/maven-v4_0_0.xsd)
here is my pom.xml file
<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
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.haifengl</groupId>
<packaging>jar</packaging>
<artifactId>smile-plot</artifactId>
<version>1.1.0</version>
<name>Smile Plot</name>
<description>Statistical Machine Intelligence and Learning Engine -- Plot</description>
<url>http://github.com/haifengl/smile</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>Haifeng Li</name>
<email>haifeng.hli#gmail.com</email>
<url>http://haifengl.wordpress.com</url>
<roles>
<role>architect</role>
<role>developer</role>
</roles>
<timezone>America/New_York</timezone>
<properties>
<twitter>#haifengl</twitter>
</properties>
</developer>
</developers>
<scm>
<connection>scm:git:git#github.com:haifengl/smile.git</connection>
<developerConnection>scm:git:git#github.com:haifengl/smile.git</developerConnection>
<url>git#github.com:haifengl/smile.git</url>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.github.haifengl</groupId>
<artifactId>smile-math</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>com.github.haifengl</groupId>
<artifactId>smile-core</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.swinglabs</groupId>
<artifactId>swingx</artifactId>
<version>1.6.1</version>
</dependency>
</dependencies>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<profiles>
<profile>
<id>doclint-java8-disable</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.3</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>

Categories

Resources