Modified: websites/production/maven/content/plugins-archives/maven-toolchains-plugin-LATEST/xref/org/apache/maven/plugin/toolchain/ToolchainMojo.html ============================================================================== --- websites/production/maven/content/plugins-archives/maven-toolchains-plugin-LATEST/xref/org/apache/maven/plugin/toolchain/ToolchainMojo.html (original) +++ websites/production/maven/content/plugins-archives/maven-toolchains-plugin-LATEST/xref/org/apache/maven/plugin/toolchain/ToolchainMojo.html Sat Nov 8 23:34:34 2014 @@ -110,109 +110,131 @@ <a class="jxr_linenumber" name="L102" href="#L102">102</a> <strong class="jxr_keyword">for</strong> ( String type : nonMatchedTypes ) <a class="jxr_linenumber" name="L103" href="#L103">103</a> { <a class="jxr_linenumber" name="L104" href="#L104">104</a> buff.append( '\n' ); -<a class="jxr_linenumber" name="L105" href="#L105">105</a> buff.append( type ); -<a class="jxr_linenumber" name="L106" href="#L106">106</a> -<a class="jxr_linenumber" name="L107" href="#L107">107</a> Map<String, String> params = toolchains.getParams( type ); -<a class="jxr_linenumber" name="L108" href="#L108">108</a> -<a class="jxr_linenumber" name="L109" href="#L109">109</a> <strong class="jxr_keyword">if</strong> ( params.size() > 0 ) -<a class="jxr_linenumber" name="L110" href="#L110">110</a> { -<a class="jxr_linenumber" name="L111" href="#L111">111</a> buff.append( <span class="jxr_string">" ["</span> ); -<a class="jxr_linenumber" name="L112" href="#L112">112</a> -<a class="jxr_linenumber" name="L113" href="#L113">113</a> <strong class="jxr_keyword">for</strong> ( Map.Entry<String, String> param : params.entrySet() ) -<a class="jxr_linenumber" name="L114" href="#L114">114</a> { -<a class="jxr_linenumber" name="L115" href="#L115">115</a> buff.append( <span class="jxr_string">" "</span> ).append( param.getKey() ).append( <span class="jxr_string">"='"</span> ).append( param.getValue() ); -<a class="jxr_linenumber" name="L116" href="#L116">116</a> buff.append( <span class="jxr_string">"'"</span> ); -<a class="jxr_linenumber" name="L117" href="#L117">117</a> } -<a class="jxr_linenumber" name="L118" href="#L118">118</a> buff.append( <span class="jxr_string">" ]"</span> ); -<a class="jxr_linenumber" name="L119" href="#L119">119</a> } -<a class="jxr_linenumber" name="L120" href="#L120">120</a> } -<a class="jxr_linenumber" name="L121" href="#L121">121</a> -<a class="jxr_linenumber" name="L122" href="#L122">122</a> getLog().error( buff.toString() ); -<a class="jxr_linenumber" name="L123" href="#L123">123</a> -<a class="jxr_linenumber" name="L124" href="#L124">124</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoFailureException( buff.toString() -<a class="jxr_linenumber" name="L125" href="#L125">125</a> + <span class="jxr_string">"\nPlease make sure you define the required toolchains in your ~/.m2/toolchains.xml file."</span> ); -<a class="jxr_linenumber" name="L126" href="#L126">126</a> } -<a class="jxr_linenumber" name="L127" href="#L127">127</a> } -<a class="jxr_linenumber" name="L128" href="#L128">128</a> -<a class="jxr_linenumber" name="L129" href="#L129">129</a> <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">boolean</strong> selectToolchain( String type, Map<String, String> params ) -<a class="jxr_linenumber" name="L130" href="#L130">130</a> <strong class="jxr_keyword">throws</strong> MojoExecutionException -<a class="jxr_linenumber" name="L131" href="#L131">131</a> { -<a class="jxr_linenumber" name="L132" href="#L132">132</a> getLog().info( <span class="jxr_string">"Required toolchain type:"</span> + type ); +<a class="jxr_linenumber" name="L105" href="#L105">105</a> buff.append( getToolchainRequirementAsString( type, toolchains.getParams( type ) ) ); +<a class="jxr_linenumber" name="L106" href="#L106">106</a> } +<a class="jxr_linenumber" name="L107" href="#L107">107</a> +<a class="jxr_linenumber" name="L108" href="#L108">108</a> getLog().error( buff.toString() ); +<a class="jxr_linenumber" name="L109" href="#L109">109</a> +<a class="jxr_linenumber" name="L110" href="#L110">110</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoFailureException( buff.toString() +<a class="jxr_linenumber" name="L111" href="#L111">111</a> + <span class="jxr_string">"\nPlease make sure you define the required toolchains in your ~/.m2/toolchains.xml file."</span> ); +<a class="jxr_linenumber" name="L112" href="#L112">112</a> } +<a class="jxr_linenumber" name="L113" href="#L113">113</a> } +<a class="jxr_linenumber" name="L114" href="#L114">114</a> +<a class="jxr_linenumber" name="L115" href="#L115">115</a> <strong class="jxr_keyword">protected</strong> String getToolchainRequirementAsString( String type, Map<String, String> params ) +<a class="jxr_linenumber" name="L116" href="#L116">116</a> { +<a class="jxr_linenumber" name="L117" href="#L117">117</a> StringBuilder buff = <strong class="jxr_keyword">new</strong> StringBuilder(); +<a class="jxr_linenumber" name="L118" href="#L118">118</a> +<a class="jxr_linenumber" name="L119" href="#L119">119</a> buff.append( type ).append( <span class="jxr_string">" ["</span> ); +<a class="jxr_linenumber" name="L120" href="#L120">120</a> +<a class="jxr_linenumber" name="L121" href="#L121">121</a> <strong class="jxr_keyword">if</strong> ( params.size() == 0 ) +<a class="jxr_linenumber" name="L122" href="#L122">122</a> { +<a class="jxr_linenumber" name="L123" href="#L123">123</a> buff.append( <span class="jxr_string">" any"</span> ); +<a class="jxr_linenumber" name="L124" href="#L124">124</a> } +<a class="jxr_linenumber" name="L125" href="#L125">125</a> <strong class="jxr_keyword">else</strong> +<a class="jxr_linenumber" name="L126" href="#L126">126</a> { +<a class="jxr_linenumber" name="L127" href="#L127">127</a> <strong class="jxr_keyword">for</strong> ( Map.Entry<String, String> param : params.entrySet() ) +<a class="jxr_linenumber" name="L128" href="#L128">128</a> { +<a class="jxr_linenumber" name="L129" href="#L129">129</a> buff.append( <span class="jxr_string">" "</span> ).append( param.getKey() ).append( <span class="jxr_string">"='"</span> ).append( param.getValue() ); +<a class="jxr_linenumber" name="L130" href="#L130">130</a> buff.append( <span class="jxr_string">"'"</span> ); +<a class="jxr_linenumber" name="L131" href="#L131">131</a> } +<a class="jxr_linenumber" name="L132" href="#L132">132</a> } <a class="jxr_linenumber" name="L133" href="#L133">133</a> -<a class="jxr_linenumber" name="L134" href="#L134">134</a> <strong class="jxr_keyword">try</strong> -<a class="jxr_linenumber" name="L135" href="#L135">135</a> { -<a class="jxr_linenumber" name="L136" href="#L136">136</a> ToolchainPrivate[] tcs = getToolchains( type ); -<a class="jxr_linenumber" name="L137" href="#L137">137</a> -<a class="jxr_linenumber" name="L138" href="#L138">138</a> <strong class="jxr_keyword">for</strong> ( ToolchainPrivate tc : tcs ) -<a class="jxr_linenumber" name="L139" href="#L139">139</a> { -<a class="jxr_linenumber" name="L140" href="#L140">140</a> <strong class="jxr_keyword">if</strong> ( tc.matchesRequirements( params ) ) -<a class="jxr_linenumber" name="L141" href="#L141">141</a> { -<a class="jxr_linenumber" name="L142" href="#L142">142</a> getLog().info( <span class="jxr_string">"Toolchain ("</span> + type + <span class="jxr_string">") matched: "</span> + tc ); -<a class="jxr_linenumber" name="L143" href="#L143">143</a> -<a class="jxr_linenumber" name="L144" href="#L144">144</a> <em class="jxr_comment">// store matching toolchain to build context</em> -<a class="jxr_linenumber" name="L145" href="#L145">145</a> toolchainManagerPrivate.storeToolchainToBuildContext( tc, session ); -<a class="jxr_linenumber" name="L146" href="#L146">146</a> -<a class="jxr_linenumber" name="L147" href="#L147">147</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>; -<a class="jxr_linenumber" name="L148" href="#L148">148</a> } -<a class="jxr_linenumber" name="L149" href="#L149">149</a> } -<a class="jxr_linenumber" name="L150" href="#L150">150</a> } -<a class="jxr_linenumber" name="L151" href="#L151">151</a> <strong class="jxr_keyword">catch</strong> ( MisconfiguredToolchainException ex ) -<a class="jxr_linenumber" name="L152" href="#L152">152</a> { -<a class="jxr_linenumber" name="L153" href="#L153">153</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( <span class="jxr_string">"Misconfigured toolchains."</span>, ex ); -<a class="jxr_linenumber" name="L154" href="#L154">154</a> } -<a class="jxr_linenumber" name="L155" href="#L155">155</a> -<a class="jxr_linenumber" name="L156" href="#L156">156</a> <strong class="jxr_keyword">return</strong> false; -<a class="jxr_linenumber" name="L157" href="#L157">157</a> } +<a class="jxr_linenumber" name="L134" href="#L134">134</a> buff.append( <span class="jxr_string">" ]"</span> ); +<a class="jxr_linenumber" name="L135" href="#L135">135</a> +<a class="jxr_linenumber" name="L136" href="#L136">136</a> <strong class="jxr_keyword">return</strong> buff.toString(); +<a class="jxr_linenumber" name="L137" href="#L137">137</a> } +<a class="jxr_linenumber" name="L138" href="#L138">138</a> +<a class="jxr_linenumber" name="L139" href="#L139">139</a> <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">boolean</strong> selectToolchain( String type, Map<String, String> params ) +<a class="jxr_linenumber" name="L140" href="#L140">140</a> <strong class="jxr_keyword">throws</strong> MojoExecutionException +<a class="jxr_linenumber" name="L141" href="#L141">141</a> { +<a class="jxr_linenumber" name="L142" href="#L142">142</a> getLog().info( <span class="jxr_string">"Required toolchain: "</span> + getToolchainRequirementAsString( type, params ) ); +<a class="jxr_linenumber" name="L143" href="#L143">143</a> <strong class="jxr_keyword">int</strong> typeFound = 0; +<a class="jxr_linenumber" name="L144" href="#L144">144</a> +<a class="jxr_linenumber" name="L145" href="#L145">145</a> <strong class="jxr_keyword">try</strong> +<a class="jxr_linenumber" name="L146" href="#L146">146</a> { +<a class="jxr_linenumber" name="L147" href="#L147">147</a> ToolchainPrivate[] tcs = getToolchains( type ); +<a class="jxr_linenumber" name="L148" href="#L148">148</a> +<a class="jxr_linenumber" name="L149" href="#L149">149</a> <strong class="jxr_keyword">for</strong> ( ToolchainPrivate tc : tcs ) +<a class="jxr_linenumber" name="L150" href="#L150">150</a> { +<a class="jxr_linenumber" name="L151" href="#L151">151</a> <strong class="jxr_keyword">if</strong> ( !type.equals( tc.getType() ) ) +<a class="jxr_linenumber" name="L152" href="#L152">152</a> { +<a class="jxr_linenumber" name="L153" href="#L153">153</a> <em class="jxr_comment">// useful because of MNG-5716</em> +<a class="jxr_linenumber" name="L154" href="#L154">154</a> <strong class="jxr_keyword">continue</strong>; +<a class="jxr_linenumber" name="L155" href="#L155">155</a> } +<a class="jxr_linenumber" name="L156" href="#L156">156</a> +<a class="jxr_linenumber" name="L157" href="#L157">157</a> typeFound++; <a class="jxr_linenumber" name="L158" href="#L158">158</a> -<a class="jxr_linenumber" name="L159" href="#L159">159</a> <strong class="jxr_keyword">private</strong> ToolchainPrivate[] getToolchains( String type ) -<a class="jxr_linenumber" name="L160" href="#L160">160</a> <strong class="jxr_keyword">throws</strong> MojoExecutionException, MisconfiguredToolchainException -<a class="jxr_linenumber" name="L161" href="#L161">161</a> { -<a class="jxr_linenumber" name="L162" href="#L162">162</a> Class<?> managerClass = toolchainManagerPrivate.getClass(); -<a class="jxr_linenumber" name="L163" href="#L163">163</a> -<a class="jxr_linenumber" name="L164" href="#L164">164</a> <strong class="jxr_keyword">try</strong> -<a class="jxr_linenumber" name="L165" href="#L165">165</a> { -<a class="jxr_linenumber" name="L166" href="#L166">166</a> <strong class="jxr_keyword">try</strong> -<a class="jxr_linenumber" name="L167" href="#L167">167</a> { -<a class="jxr_linenumber" name="L168" href="#L168">168</a> <em class="jxr_comment">// try 3.x style API</em> -<a class="jxr_linenumber" name="L169" href="#L169">169</a> Method newMethod = -<a class="jxr_linenumber" name="L170" href="#L170">170</a> managerClass.getMethod( <span class="jxr_string">"getToolchainsForType"</span>, <strong class="jxr_keyword">new</strong> Class[] { String.<strong class="jxr_keyword">class</strong>, MavenSession.<strong class="jxr_keyword">class</strong> } ); -<a class="jxr_linenumber" name="L171" href="#L171">171</a> -<a class="jxr_linenumber" name="L172" href="#L172">172</a> <strong class="jxr_keyword">return</strong> (ToolchainPrivate[]) newMethod.invoke( toolchainManagerPrivate, type, session ); -<a class="jxr_linenumber" name="L173" href="#L173">173</a> } -<a class="jxr_linenumber" name="L174" href="#L174">174</a> <strong class="jxr_keyword">catch</strong> ( NoSuchMethodException e ) -<a class="jxr_linenumber" name="L175" href="#L175">175</a> { -<a class="jxr_linenumber" name="L176" href="#L176">176</a> <em class="jxr_comment">// try 2.x style API</em> -<a class="jxr_linenumber" name="L177" href="#L177">177</a> Method oldMethod = managerClass.getMethod( <span class="jxr_string">"getToolchainsForType"</span>, <strong class="jxr_keyword">new</strong> Class[] { String.<strong class="jxr_keyword">class</strong> } ); -<a class="jxr_linenumber" name="L178" href="#L178">178</a> -<a class="jxr_linenumber" name="L179" href="#L179">179</a> <strong class="jxr_keyword">return</strong> (ToolchainPrivate[]) oldMethod.invoke( toolchainManagerPrivate, type ); -<a class="jxr_linenumber" name="L180" href="#L180">180</a> } -<a class="jxr_linenumber" name="L181" href="#L181">181</a> } -<a class="jxr_linenumber" name="L182" href="#L182">182</a> <strong class="jxr_keyword">catch</strong> ( NoSuchMethodException e ) -<a class="jxr_linenumber" name="L183" href="#L183">183</a> { -<a class="jxr_linenumber" name="L184" href="#L184">184</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( <span class="jxr_string">"Incompatible toolchain API"</span>, e ); -<a class="jxr_linenumber" name="L185" href="#L185">185</a> } -<a class="jxr_linenumber" name="L186" href="#L186">186</a> <strong class="jxr_keyword">catch</strong> ( IllegalAccessException e ) +<a class="jxr_linenumber" name="L159" href="#L159">159</a> <strong class="jxr_keyword">if</strong> ( tc.matchesRequirements( params ) ) +<a class="jxr_linenumber" name="L160" href="#L160">160</a> { +<a class="jxr_linenumber" name="L161" href="#L161">161</a> getLog().info( <span class="jxr_string">"Found matching toolchain for type "</span> + type + <span class="jxr_string">": "</span> + tc ); +<a class="jxr_linenumber" name="L162" href="#L162">162</a> +<a class="jxr_linenumber" name="L163" href="#L163">163</a> <em class="jxr_comment">// store matching toolchain to build context</em> +<a class="jxr_linenumber" name="L164" href="#L164">164</a> toolchainManagerPrivate.storeToolchainToBuildContext( tc, session ); +<a class="jxr_linenumber" name="L165" href="#L165">165</a> +<a class="jxr_linenumber" name="L166" href="#L166">166</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>; +<a class="jxr_linenumber" name="L167" href="#L167">167</a> } +<a class="jxr_linenumber" name="L168" href="#L168">168</a> } +<a class="jxr_linenumber" name="L169" href="#L169">169</a> } +<a class="jxr_linenumber" name="L170" href="#L170">170</a> <strong class="jxr_keyword">catch</strong> ( MisconfiguredToolchainException ex ) +<a class="jxr_linenumber" name="L171" href="#L171">171</a> { +<a class="jxr_linenumber" name="L172" href="#L172">172</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( <span class="jxr_string">"Misconfigured toolchains."</span>, ex ); +<a class="jxr_linenumber" name="L173" href="#L173">173</a> } +<a class="jxr_linenumber" name="L174" href="#L174">174</a> +<a class="jxr_linenumber" name="L175" href="#L175">175</a> getLog().error( <span class="jxr_string">"No toolchain "</span> + ( ( typeFound == 0 ) ? <span class="jxr_string">"found"</span> : ( <span class="jxr_string">"matched from "</span> + typeFound + <span class="jxr_string">" found"</span> ) ) +<a class="jxr_linenumber" name="L176" href="#L176">176</a> + <span class="jxr_string">" for type "</span> + type ); +<a class="jxr_linenumber" name="L177" href="#L177">177</a> +<a class="jxr_linenumber" name="L178" href="#L178">178</a> <strong class="jxr_keyword">return</strong> false; +<a class="jxr_linenumber" name="L179" href="#L179">179</a> } +<a class="jxr_linenumber" name="L180" href="#L180">180</a> +<a class="jxr_linenumber" name="L181" href="#L181">181</a> <strong class="jxr_keyword">private</strong> ToolchainPrivate[] getToolchains( String type ) +<a class="jxr_linenumber" name="L182" href="#L182">182</a> <strong class="jxr_keyword">throws</strong> MojoExecutionException, MisconfiguredToolchainException +<a class="jxr_linenumber" name="L183" href="#L183">183</a> { +<a class="jxr_linenumber" name="L184" href="#L184">184</a> Class<?> managerClass = toolchainManagerPrivate.getClass(); +<a class="jxr_linenumber" name="L185" href="#L185">185</a> +<a class="jxr_linenumber" name="L186" href="#L186">186</a> <strong class="jxr_keyword">try</strong> <a class="jxr_linenumber" name="L187" href="#L187">187</a> { -<a class="jxr_linenumber" name="L188" href="#L188">188</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( <span class="jxr_string">"Incompatible toolchain API"</span>, e ); -<a class="jxr_linenumber" name="L189" href="#L189">189</a> } -<a class="jxr_linenumber" name="L190" href="#L190">190</a> <strong class="jxr_keyword">catch</strong> ( InvocationTargetException e ) -<a class="jxr_linenumber" name="L191" href="#L191">191</a> { -<a class="jxr_linenumber" name="L192" href="#L192">192</a> Throwable cause = e.getCause(); +<a class="jxr_linenumber" name="L188" href="#L188">188</a> <strong class="jxr_keyword">try</strong> +<a class="jxr_linenumber" name="L189" href="#L189">189</a> { +<a class="jxr_linenumber" name="L190" href="#L190">190</a> <em class="jxr_comment">// try 3.x style API</em> +<a class="jxr_linenumber" name="L191" href="#L191">191</a> Method newMethod = +<a class="jxr_linenumber" name="L192" href="#L192">192</a> managerClass.getMethod( <span class="jxr_string">"getToolchainsForType"</span>, <strong class="jxr_keyword">new</strong> Class[] { String.<strong class="jxr_keyword">class</strong>, MavenSession.<strong class="jxr_keyword">class</strong> } ); <a class="jxr_linenumber" name="L193" href="#L193">193</a> -<a class="jxr_linenumber" name="L194" href="#L194">194</a> <strong class="jxr_keyword">if</strong> ( cause instanceof RuntimeException ) -<a class="jxr_linenumber" name="L195" href="#L195">195</a> { -<a class="jxr_linenumber" name="L196" href="#L196">196</a> <strong class="jxr_keyword">throw</strong> (RuntimeException) cause; -<a class="jxr_linenumber" name="L197" href="#L197">197</a> } -<a class="jxr_linenumber" name="L198" href="#L198">198</a> <strong class="jxr_keyword">if</strong> ( cause instanceof MisconfiguredToolchainException ) -<a class="jxr_linenumber" name="L199" href="#L199">199</a> { -<a class="jxr_linenumber" name="L200" href="#L200">200</a> <strong class="jxr_keyword">throw</strong> (MisconfiguredToolchainException) cause; -<a class="jxr_linenumber" name="L201" href="#L201">201</a> } -<a class="jxr_linenumber" name="L202" href="#L202">202</a> -<a class="jxr_linenumber" name="L203" href="#L203">203</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( <span class="jxr_string">"Incompatible toolchain API"</span>, e ); -<a class="jxr_linenumber" name="L204" href="#L204">204</a> } -<a class="jxr_linenumber" name="L205" href="#L205">205</a> } -<a class="jxr_linenumber" name="L206" href="#L206">206</a> -<a class="jxr_linenumber" name="L207" href="#L207">207</a> } +<a class="jxr_linenumber" name="L194" href="#L194">194</a> <strong class="jxr_keyword">return</strong> (ToolchainPrivate[]) newMethod.invoke( toolchainManagerPrivate, type, session ); +<a class="jxr_linenumber" name="L195" href="#L195">195</a> } +<a class="jxr_linenumber" name="L196" href="#L196">196</a> <strong class="jxr_keyword">catch</strong> ( NoSuchMethodException e ) +<a class="jxr_linenumber" name="L197" href="#L197">197</a> { +<a class="jxr_linenumber" name="L198" href="#L198">198</a> <em class="jxr_comment">// try 2.x style API</em> +<a class="jxr_linenumber" name="L199" href="#L199">199</a> Method oldMethod = managerClass.getMethod( <span class="jxr_string">"getToolchainsForType"</span>, <strong class="jxr_keyword">new</strong> Class[] { String.<strong class="jxr_keyword">class</strong> } ); +<a class="jxr_linenumber" name="L200" href="#L200">200</a> +<a class="jxr_linenumber" name="L201" href="#L201">201</a> <strong class="jxr_keyword">return</strong> (ToolchainPrivate[]) oldMethod.invoke( toolchainManagerPrivate, type ); +<a class="jxr_linenumber" name="L202" href="#L202">202</a> } +<a class="jxr_linenumber" name="L203" href="#L203">203</a> } +<a class="jxr_linenumber" name="L204" href="#L204">204</a> <strong class="jxr_keyword">catch</strong> ( NoSuchMethodException e ) +<a class="jxr_linenumber" name="L205" href="#L205">205</a> { +<a class="jxr_linenumber" name="L206" href="#L206">206</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( <span class="jxr_string">"Incompatible toolchain API"</span>, e ); +<a class="jxr_linenumber" name="L207" href="#L207">207</a> } +<a class="jxr_linenumber" name="L208" href="#L208">208</a> <strong class="jxr_keyword">catch</strong> ( IllegalAccessException e ) +<a class="jxr_linenumber" name="L209" href="#L209">209</a> { +<a class="jxr_linenumber" name="L210" href="#L210">210</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( <span class="jxr_string">"Incompatible toolchain API"</span>, e ); +<a class="jxr_linenumber" name="L211" href="#L211">211</a> } +<a class="jxr_linenumber" name="L212" href="#L212">212</a> <strong class="jxr_keyword">catch</strong> ( InvocationTargetException e ) +<a class="jxr_linenumber" name="L213" href="#L213">213</a> { +<a class="jxr_linenumber" name="L214" href="#L214">214</a> Throwable cause = e.getCause(); +<a class="jxr_linenumber" name="L215" href="#L215">215</a> +<a class="jxr_linenumber" name="L216" href="#L216">216</a> <strong class="jxr_keyword">if</strong> ( cause instanceof RuntimeException ) +<a class="jxr_linenumber" name="L217" href="#L217">217</a> { +<a class="jxr_linenumber" name="L218" href="#L218">218</a> <strong class="jxr_keyword">throw</strong> (RuntimeException) cause; +<a class="jxr_linenumber" name="L219" href="#L219">219</a> } +<a class="jxr_linenumber" name="L220" href="#L220">220</a> <strong class="jxr_keyword">if</strong> ( cause instanceof MisconfiguredToolchainException ) +<a class="jxr_linenumber" name="L221" href="#L221">221</a> { +<a class="jxr_linenumber" name="L222" href="#L222">222</a> <strong class="jxr_keyword">throw</strong> (MisconfiguredToolchainException) cause; +<a class="jxr_linenumber" name="L223" href="#L223">223</a> } +<a class="jxr_linenumber" name="L224" href="#L224">224</a> +<a class="jxr_linenumber" name="L225" href="#L225">225</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( <span class="jxr_string">"Incompatible toolchain API"</span>, e ); +<a class="jxr_linenumber" name="L226" href="#L226">226</a> } +<a class="jxr_linenumber" name="L227" href="#L227">227</a> } +<a class="jxr_linenumber" name="L228" href="#L228">228</a> +<a class="jxr_linenumber" name="L229" href="#L229">229</a> } </pre> <hr/> <div id="footer">Copyright © 2002–2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</div>