I have a spring boot project (Project A) created which do contains commonly used methods and I have hosted this project in GitHub deployed artifacts and used it as a dependency in other projects (Project B, C ..) to reuse those methods. I have one common method created in Project A which does read the value from the application properties file which works fine locally but when I deploy the artifacts to GitHub and use it as a dependency it is not able to read the value from an application properties file and read as null. Maybe I am not including the properties files while deploying artifacts for Project A correctly.
pom.xml (Project A)
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.abc</groupId>
<artifactId>api-authenticator</artifactId>
<version>1.0.2</version>
<name>API Authenticator</name>
<description>Project to authenticate API usage</description>
<distributionManagement>
<repository>
<id>internal.repo</id>
<name>Staging Repository</name>
<url>file://${project.build.directory}/${version}</url>
</repository>
</distributionManagement>
<properties>
<github.global.server>github</github.global.server>
<java.version>11</java.version>
<java-jwt.version>3.16.0</java-jwt.version>
<jwks-rsa.version>0.18.0</jwks-rsa.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>${java-jwt.version}</version>
</dependency>
<dependency>
<groupId>com.auth0</groupId>
<artifactId>jwks-rsa</artifactId>
<version>${jwks-rsa.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>resources</directory>
<targetPath>src/main/resources</targetPath>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.12</version>
<configuration>
<message>Maven artifacts for ${project.version}</message>
<noJekyll>true</noJekyll>
<outputDirectory>${project.build.directory}</outputDirectory>
<branch>refs/heads/${version}</branch>
<includes>
<include>**/*</include>
</includes>
<merge>true</merge>
<repositoryName>api-authenticator</repositoryName>
<repositoryOwner>me</repositoryOwner>
<server>github</server>
</configuration>
<executions>
<execution>
<goals>
<goal>site</goal>
</goals>
<phase>deploy</phase>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<files>
<file>
${project.basedir}/src/main/resources/application.properties
</file>
</files>
<altDeploymentRepository>
internal.repo::default::file://${project.build.directory}/${version}
</altDeploymentRepository>
</configuration>
</plugin>
</plugins>
</build>
</project>
Related
I would like to create simple Java SOAP web service that should run on Tomcat 10. I'm using Eclipse and Maven for this purpose. I'm using artifact maven-archetype-webapp for this purpose. After project was created I just removed webapp folder and have created java one instead of it. I suppose there I can put my Java code for web services? But how to tell Eclipse to treat this folder as Java source location? I can managed it like system folders, but not Java packages. What other directory structure changes I should do in order to create Java SOAP server?
pom.xml:
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>foo.bar</groupId>
<artifactId>MyServiceWS</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>MyServiceWS Maven Webapp</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/jakarta.jws/jakarta.jws-api -->
<dependency>
<groupId>jakarta.jws</groupId>
<artifactId>jakarta.jws-api</artifactId>
<version>2.1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/jakarta.xml.bind/jakarta.xml.bind-api -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/jakarta.xml.soap/jakarta.xml.soap-api -->
<dependency>
<groupId>jakarta.xml.soap</groupId>
<artifactId>jakarta.xml.soap-api</artifactId>
<version>1.4.2</version>
</dependency>
</dependencies>
<build>
<finalName>MyServiceWS</finalName>
<directory>${basedir}/target</directory>
<!-- main -->
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
<outputDirectory>${basedir}/target/classes</outputDirectory>
<!-- test -->
<testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
<testOutputDirectory>${basedir}/target/test-classes</testOutputDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>*.properties</include>
<include>*.xml</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warSourceDirectory>${basedir}/src/main/webapp/WebContent</warSourceDirectory>
<warSourceExcludes>${basedir}/src/main/webapp/WEB-INF/web.xml</warSourceExcludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
I created maven artifact, that have dependencyies on gson and ok3http.
The pom.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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>test</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.7</version>
</dependency>
</dependencies>
<build>
<finalName>testConnect</finalName>
<plugins>
<!-- download source code in Eclipse-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
</configuration>
</plugin>
<!-- Set a compiler level -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- Copy project dependency -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!-- exclude junit, we need runtime dependency only -->
<includeScope>runtime</includeScope>
<outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Now I send it to local repository (later will send to Maven central) and I want people to be able to use my artifact in their pom files like:
<dependency>
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
</dependency>
It builds ok, but when I try to use it, it throws error that it can not found gson and ok3http.
If I add also:
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.7</version>
</dependency>
It started to work. Is it possible that people can add dependency to my artifact only and other dependencies will add automatically or something like this?? Thanks!
Although will be very thankful if you give me the right documentations how to send my code to maven repo.
I am developing an eclipse plugin, Where i need to use the tools.jar as an dependency.As we know eclipse does not take normal jar as dependencies. so i tried to change the jar as osgi bundle. But the generated osgi bundle does not contain the com.sun packages inside.
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.7.0</version>
<scope>system</scope>
<systemPath>${env.JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
I tried to bundle all the dependencies given in the 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.nuwaza.aqua</groupId>
<artifactId>osgi-tool-bundle</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.7.0</version>
<scope>system</scope>
<systemPath>${env.JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>4.3.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>1.4.0</version>
<extensions>true</extensions>
<configuration>
<manifestLocation>META-INF</manifestLocation>
<instructions>
<Bundle-SymbolicName>osgi-tool-bundle</Bundle-SymbolicName>
<Bundle-Name>osgi-tool-bundle</Bundle-Name>
<Bundle-Version>1.0.0</Bundle-Version>
<Export-Package>*</Export-Package>
<Private-Package>com.nuwaza.aqua.bundle</Private-Package>
<Bundle-Activator>com.nuwaza.aqua.bundle.Activator</Bundle-Activator>
<Import-Package>*;resolution:=optional</Import-Package>
<Embed-Dependency>*;scope=compile|runtime|system</Embed-Dependency>
<Embed-Directory>target/dependency</Embed-Directory>
<Embed-StripGroup>true</Embed-StripGroup>
<Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>
<profiles>
<profile>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<properties>
<osgi-version-qualifier>qualifier</osgi-version-qualifier>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<!-- PDE does not honour custom manifest location -->
<manifestLocation>META-INF</manifestLocation>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
The generated bundle only contains org.osgi packages not com.sun packages. I even included system scope in <Embed-Dependency>*;scope=compile|runtime|system</Embed-Dependency>.
What am i missing ?
I have a multi-module maven project where module A/B/C depends on module D.
Plugin maven-surefire-plugin is used for test phrase.
However,
mvn clean package
doesn't generate surefire-reports under **/target/
And
mvn clean; mvn package
could generate surefire-reports as expected.
This confused me a lot. Although the workaround for me is simply splitting to two mvn commands but I would like to know why?
Versions:
maven 3.3.3
jdk 1.7.0
maven-surefire-plugin 2.14
Root Pom:
<?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>
<groupId>org.jzako.test</groupId>
<artifactId>FeedbackSystem</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>FeedbackSystem</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.21</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-testng</artifactId>
<version>1.6.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<modules>
<module>ModuleA</module>
<module>ModuleB</module>
<module>ModuleC</module>
<module>Utility</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14</version>
<configuration>
<forkMode>never</forkMode>
</configuration>
</plugin>
</plugins>
</build>
</project>
Module A Pom:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jzako.test</groupId>
<artifactId>FeedbackSystem</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>org.jzako.test</groupId>
<artifactId>ModuleA</artifactId>
<version>1.0-SNAPSHOT</version>
<name>ModuleA</name>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>org.jzako.test.main.LightweightFeedbackStatisticsMain</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>${basedir}/../conf/dev</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>${basedir}/../conf/dev</directory>
</testResource>
</testResources>
</build>
<dependencies>
<dependency>
<groupId>org.jzako.test</groupId>
<artifactId>Utility</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Multi-module Relationship
Module A/B/C depends on Utility Module and no dependencies among Module A/B/C.
Update:
It seems everything's fine for a single maven module projects. Something related to the multi-modules?
I follow this tutorial :https://platform.netbeans.org/tutorials/nbm-maven-crud.html and I have an issue.
I tried to create the sample "maven crud sample application" and my "maven netbeans application" and I get always the same error. When I run the project, I get the following exception:
--- nbm-maven-plugin:3.3:run-platform (default-cli) # application ---
Executing: /bin/sh -c "/home/pea-rep/NetBeansProjects/JDK6/test maven//MavenCRUDSample/application/target/foo/bin/foo" --userdir '"/home/pea-rep/NetBeansProjects/JDK6/test maven//MavenCRUDSample/application/target/userdir"' -J-Dnetbeans.logger.console=true -J-ea --branding foo --jdkhome /usr/local/java/jdk1.6.0_45
Exception in thread "main" java.lang.NoClassDefFoundError: maven//MavenCRUDSample/application/target/userdir/var/log/heapdump/hprof
Caused by: java.lang.ClassNotFoundException: maven.MavenCRUDSample.application.target.userdir.var.log.heapdump.hprof
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: maven/MavenCRUDSample/application/target/userdir/var/log/heapdump.hprof. Program will exit.
In this tutorial, I don't see any modification to make at the main class
I did the same tutorial without MAVEN and it works : https://platform.netbeans.org/tutorials/nbm-crud.html
With this error, I can't run my application and have my netbeans platform window. Someone knows why I have this?
I'm on Netbeans 6.9.1 with jdk1.6.0_45 and maven-3.2.1
OS : Ubuntu 64bit
edit :
I've got 4 pom.xml :
Parent : crud-sample-application – netbeans Platform Application
crud-sample-application – Netbeans Platform based application
crud-sample-application – Platform application branding ressources
crud-sample-application – sample Netbeans Module
Sorry I wasn't able to split it.
<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.netbeans</groupId>
<artifactId>crud-sample-application</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>crud-sample-application - NetBeans Platform Application</name>
<repositories>
<!-- this is a remote repository hosting the netbeans api artifacts.
the versions of the artifacts are netbeans IDE release based, eg. RELEASE65
You might want to use your own repository. To create one, use the nbm:populate-repository goal.
-->
<repository>
<id>netbeans</id>
<name>repository hosting netbeans.org api artifacts</name>
<url>http://bits.netbeans.org/maven2</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-actions</artifactId>
<version>RELEASE68</version>
</dependency>
</dependencies>
<build>
<plugins>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<version>3.1</version>
<extensions>true</extensions>
<configuration>
<descriptor>src/main/nbm/module.xml</descriptor>
<brandingToken>${brandingToken}</brandingToken>
<cluster>foobar</cluster>
</configuration>
</plugin>
<!-- netbeans modules in 5.5+ are 1.5 compatible -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<modules>
<module>crudsample</module>
<module>branding</module>
<module>application</module>
</modules>
<properties>
<netbeans.version>RELEASE68</netbeans.version>
<brandingToken>foo</brandingToken>
</properties>
</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 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.netbeans</groupId>
<artifactId>crud-sample-application</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>application</artifactId>
<packaging>nbm-application</packaging>
<version>1.0-SNAPSHOT</version>
<name>crud-sample-application - NetBeans Platform based application</name>
<dependencies>
<dependency>
<groupId>org.netbeans.cluster</groupId>
<artifactId>platform11</artifactId>
<version>${netbeans.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.netbeans</groupId>
<artifactId>crudsample</artifactId>
<version>1.0-SNAPSHOT</version>
<type>nbm</type>
</dependency>
<dependency>
<groupId>org.netbeans</groupId>
<artifactId>branding</artifactId>
<version>1.0-SNAPSHOT</version>
<type>nbm</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<version>3.3</version>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>deployment</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<executions>
<execution>
<id>updatesite</id>
<phase>package</phase>
<goals>
<goal>autoupdate</goal>
</goals>
<configuration>
<!--distBase>central::default::http://repo1.maven.org/maven2</distBase-->
</configuration>
</execution>
<execution>
<id>webstart</id>
<phase>package</phase>
<goals>
<goal>webstart-app</goal>
</goals>
<configuration>
<codebase>${project.build.directory}/webstart/${brandingToken}</codebase>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</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 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.netbeans</groupId>
<artifactId>crud-sample-application</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>branding</artifactId>
<packaging>nbm</packaging>
<version>1.0-SNAPSHOT</version>
<name>crud-sample-application - Platform application branding resources</name>
<dependencies>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util</artifactId>
<version>${netbeans.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<executions>
<execution>
<id>branding</id>
<phase>process-resources</phase>
<goals>
<goal>branding</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<configuration>
<!-- to have the jar plugin pickup the nbm generated manifest -->
<useDefaultManifestFile>true</useDefaultManifestFile>
</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 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.netbeans</groupId>
<artifactId>crud-sample-application</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>nbm</packaging>
<version>1.0-SNAPSHOT</version>
<name>crud-sample-application - sample NetBeans Module</name>
<dependencies>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util</artifactId>
<version>RELEASE68</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-windows</artifactId>
<version>RELEASE68</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-awt</artifactId>
<version>RELEASE68</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-explorer</artifactId>
<version>RELEASE68</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-nodes</artifactId>
<version>RELEASE68</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-dialogs</artifactId>
<version>RELEASE68</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-execution</artifactId>
<version>RELEASE68</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.5.3.0_1</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<configuration>
<!-- to have the jar plugin pickup the nbm generated manifest -->
<useDefaultManifestFile>true</useDefaultManifestFile>
</configuration>
</plugin>
</plugins>
</build>
<groupId>org.netbeans</groupId>
<artifactId>crudsample</artifactId>
<repositories>
<repository>
<url>http://ftp.ing.umu.se/mirror/eclipse/rt/eclipselink/maven.repo</url>
<id>eclipselink</id>
<layout>default</layout>
<name>Repository for library Library[eclipselink]</name>
</repository>
</repositories>
</project>
I use netbeans for run my application ==> run project :
install nbm:run-platform
run project via main() :
process-classes org.codehaus.mojo:exec-maven-plugin:1.1.1:exec
avec les arguments :
exec.classpathScope=${classPathScope}
exec.args=-classpath %classpath ${packageClassName}
exec.executable=java "
Thanks,
M.
Problem solve, When netbeans execute :
/bin/sh -c "/home/pea-rep/NetBeansProjects/JDK6/test maven//MavenCRUDSample/application/target/foo/bin/foo" --userdir '"/home/pea-rep/NetBeansProjects/JDK6/test maven//MavenCRUDSample/application/target/userdir"' -J-Dnetbeans.logger.console=true -J-ea --branding foo --jdkhome /usr/local/java/jdk1.6.0_45
It doesn't like the space between maven and test. I rename my folder and it works.