maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Osipov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MANTTASKS-201) artifact:mvn generates "org.apache.tools.ant.ExitException: Permission (java.lang.RuntimePermission exitVM) was not granted" when fork=false
Date Tue, 08 Sep 2015 14:47:46 GMT

    [ https://issues.apache.org/jira/browse/MANTTASKS-201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14734923#comment-14734923
] 

Michael Osipov commented on MANTTASKS-201:
------------------------------------------

It seems like the Ant Tasks abuses Maven. The behavior is correct. If one intends to embed
Maven, one should use Maven Embedder.

> artifact:mvn generates "org.apache.tools.ant.ExitException: Permission (java.lang.RuntimePermission
exitVM) was not granted" when fork=false
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MANTTASKS-201
>                 URL: https://issues.apache.org/jira/browse/MANTTASKS-201
>             Project: Maven Ant Tasks
>          Issue Type: Bug
>          Components: mvn task
>    Affects Versions: 2.1.1
>            Reporter: Matt McHenry
>            Priority: Minor
>
> Using this simple ant target:
> {code:xml}  <target name="mvn.invoke" description="invokes maven">
>     <property environment="env"/>
>     <artifact:mvn pom="pom.xml" mavenHome="${env.M2_HOME}" fork="true">
>       <arg value="${mvn.goal}"/>
>     </artifact:mvn>
>   </target>{code}
> I get the correct behaviour:
> {noformat}
> $ M2_HOME=`cygpath -w "$M2_HOME"` ant -Dmvn.goal=-version mvn.invoke
> Searching for build.xml ...
> Buildfile: c:\Users\mmchenry\svn\cli\trunk\runtime\maven\build.xml
> mvn.setversion:
> mvn.invoke:
> [artifact:mvn] Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
> [artifact:mvn] Java version: 1.6.0_17
> [artifact:mvn] Java home: c:\Program Files\Java\jdk1.6.0_17\jre
> [artifact:mvn] Default locale: en_US, platform encoding: Cp1252
> [artifact:mvn] OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows"
> BUILD SUCCESSFUL
> Total time: 0 seconds{noformat}
> But if I set fork="false", then I get:
> {noformat}
> [artifact:mvn] Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
> [artifact:mvn] Java version: 1.6.0_17
> [artifact:mvn] Java home: c:\Program Files\Java\jdk1.6.0_17\jre
> [artifact:mvn] Default locale: en_US, platform encoding: Cp1252
> [artifact:mvn] OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows"
> [artifact:mvn] org.apache.tools.ant.ExitException: Permission (java.lang.RuntimePermission
exitVM) was not granted.
> [artifact:mvn]  at org.apache.tools.ant.types.Permissions$MySM.checkExit(Permissions.java:196)
> [artifact:mvn]  at java.lang.Runtime.exit(Runtime.java:88)
> [artifact:mvn]  at java.lang.System.exit(System.java:904)
> [artifact:mvn]  at org.codehaus.classworlds.Launcher.main(Launcher.java:376)
> [artifact:mvn]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [artifact:mvn]  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> [artifact:mvn]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> [artifact:mvn]  at java.lang.reflect.Method.invoke(Method.java:597)
> [artifact:mvn]  at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
> [artifact:mvn]  at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
> [artifact:mvn]  at org.apache.tools.ant.taskdefs.Java.run(Java.java:764)
> [artifact:mvn]  at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:218)
> [artifact:mvn]  at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:132)
> [artifact:mvn]  at org.apache.tools.ant.taskdefs.Java.execute(Java.java:105)
> [artifact:mvn]  at org.apache.maven.artifact.ant.Mvn.execute(Mvn.java:81)
> [artifact:mvn]  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
> [artifact:mvn]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [artifact:mvn]  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> [artifact:mvn]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> [artifact:mvn]  at java.lang.reflect.Method.invoke(Method.java:597)
> [artifact:mvn]  at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
> [artifact:mvn]  at org.apache.tools.ant.Task.perform(Task.java:348)
> [artifact:mvn]  at org.apache.tools.ant.Target.execute(Target.java:357)
> [artifact:mvn]  at org.apache.tools.ant.Target.performTasks(Target.java:385)
> [artifact:mvn]  at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
> [artifact:mvn]  at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
> [artifact:mvn]  at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
> [artifact:mvn]  at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
> [artifact:mvn]  at org.apache.tools.ant.Main.runBuild(Main.java:758)
> [artifact:mvn]  at org.apache.tools.ant.Main.startAnt(Main.java:217)
> [artifact:mvn]  at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
> [artifact:mvn]  at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
> [artifact:mvn] Java Result: 100
> BUILD SUCCESSFUL
> Total time: 0 seconds{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message