NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Error running maven project using exec-maven-plugin in pom.xml

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
0Ust6VGwHmz4k



Joined: 25 Sep 2011
Posts: 4

PostPosted: Sun Sep 25, 2011 12:37 pm    Post subject: Error running maven project using exec-maven-plugin in pom.xml Reply with quote

Hello,

I am on the way to switch from Eclipse to NetBeans for developing Java programs. One of the reasons for changing the IDE was the better maven support implemented in NB 7.0.1. Unfortunately, just this better maven integration seems to
make NB 7.0.1 unusable for me. I used to generate a Changelog file for my programs using svn2cl. To execute this in my build process I added the following lines to my pom.xml:


<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>/usr/bin/svn2cl</executable>
<workingDirectory>${basedir}</workingDirectory>
<commandlineArgs></commandlineArgs>
<arguments>
<argument>--break-before-msg</argument>
<argument>--include-rev</argument>
<argument>--output=target/ChangeLog</argument>
<argument>--authors=/devel/maven/sources/authors.txt</argument>
</arguments>
</configuration>
</plugin>

This works fine if I compile my program using the command line 'mvn compile':

<--- cut here --->

Using command line "mvn compile":
[DEBUG] Configuring mojo 'org.codehaus.mojo:exec-maven-plugin:1.2:exec' with basic configurator -->
[DEBUG] (f) arguments = [--break-before-msg, --include-rev, --output=target/ChangeLog, --authors=/devel/maven/sources/authors.txt]
[DEBUG] (f) basedir = /devel/maven/sources/Application/Hugo
[DEBUG] (f) classpathScope = runtime
[DEBUG] (f) executable = /usr/bin/svn2cl
[DEBUG] (f) longClasspath = false
[DEBUG] (f) project = MavenProject: de.mylab.app.Hugo:Hugo:1.0-SNAPSHOT @ /devel/maven/sources/Application/Hugo/pom.xml
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@f38cf0
[DEBUG] (f) skip = false
[DEBUG] (f) workingDirectory = /devel/maven/sources/Application/Hugo
[DEBUG] -- end configuration --
[DEBUG] Toolchains are ignored, 'executable' parameter is set to /usr/bin/svn2cl
[DEBUG] Executing command line: /usr/bin/svn2cl --break-before-msg --include-rev --output=target/ChangeLog --authors=/devel/maven/sources/authors.txt
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

<--- cut here --->

If I want to execute the program out of NetBeans 7.0.1, the build fails:

<--- cut here --->

Configuring mojo org.codehaus.mojo:exec-maven-plugin:1.2:exec from plugin realm ClassRealm[plugin>org.codehaus.mojo:exec-maven-plugin:1.2, parent: sun.misc.Launcher$AppClassLoader@1cde100]
Configuring mojo 'org.codehaus.mojo:exec-maven-plugin:1.2:exec' with basic configurator -->
(f) arguments = [--break-before-msg, --include-rev, --output=target/ChangeLog, --authors=/devel/maven/sources/authors.txt]
(f) basedir = /devel/maven/sources/Application/Hugo
(f) classpathScope = runtime
(f) commandlineArgs = -classpath %classpath de.mylab.app.Hugo.Hugo
(f) executable = /usr/bin/svn2cl
(f) longClasspath = false
(f) project = MavenProject: de.mylab.app.Hugo:Hugo:1.0-SNAPSHOT @ /devel/maven/sources/Application/Hugo/pom.xml
(f) session = org.apache.maven.execution.MavenSession@7df60a
(f) skip = false
(f) workingDirectory = /devel/maven/sources/Application/Hugo
-- end configuration --
Collected project artifacts [log4j:log4j:jar:1.2.14:compile, joda-time:joda-time:jar:2.0:compile, de.jollyday:jollyday:jar:0.4.4:compile]
Collected project classpath [/devel/maven/sources/Application/Hugo/target/classes]
dealing with log4j:log4j:jar:1.2.14:compile
dealing with joda-time:joda-time:jar:2.0:compile
dealing with de.jollyday:jollyday:jar:0.4.4:compile
Toolchains are ignored, 'executable' parameter is set to /usr/bin/svn2cl
Executing command line: /usr/bin/svn2cl -classpath /devel/maven/sources/Application/Hugo/target/classes:/devel/maven/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar:/devel/maven/repository/joda-time/joda-time/2.0/joda-time-2.0.jar:/devel/maven/repository/de/jollyday/jollyday/0.4.4/jollyday-0.4.4.jar de.mylab.app.Hugo.Hugo
svn2cl: invalid option -- -classpath
Try 'svn2cl --help' for more information.
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------

<--- cut here --->

Looking at the debug output, some Voodoo in NetBeans add a classpath argument to the call of the exec-maven-plugin. Do you have any ideas, how to suppress this effect?

Any help is really appreciated.

CU
Joerg
Back to top
0Ust6VGwHmz4k



Joined: 25 Sep 2011
Posts: 4

PostPosted: Thu Sep 29, 2011 8:38 am    Post subject: RE: Error running maven project using exec-maven-plugin in pom.xml Reply with quote

In the meantime I could solve this issue.

CU,
Joerg
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo