Home > Maven Nar > Maven Nar Cannot Deduce Version Number From

Maven Nar Cannot Deduce Version Number From

The compiler will automatically select the correct compiler (c, c++ or fortran) based on the type of sources, as specified in the patterns in AOL.c.includes, AOL.nar.src.includes and AOL.fortran.includes, where AOL is Bug in Windows compiler support due to some versions of link.exe not supporting the /version flag. Skip to content Ignore Learn more Please note that GitHub no longer supports old versions of Firefox. Browse other questions tagged maven maven-nar-plugin or ask your own question.

We recommend upgrading to the latest Safari, Google Chrome, or Firefox. This goal has no effect if there are no java sources, or if none of the java classes contain a native method. Include paths are added in this order from: any directories set in COMPILER.includePaths, where COMPILER is c, cpp or fortran. I had no idea to manually setup the AOL before this was mentioned. http://stackoverflow.com/questions/16832060/cant-build-c-c-projects-using-maven-nar-plugin

Will 107 * work in combination with . 108 */ 109 @Parameter 110 private String optionSet; 111 112 /** 113 * Clears default options 114 */ 115 @Parameter(required = true) 116 How to decline a postdoc interview if there is some possible future collaboration? To be honest, all I would like to see right now is an example NAR-file so I can get my head over how an expected output file looks like. The standard way to separate your sources for different languages would be src/main/c, src/main/c++ and src/main/fortran, but any file under src/main is searched for.

Parameter:expression="" default-value="false"Required:7475privatebooleanmap=false; Options for the linker Defaults to Architecture-OS-Linker specific values. The standard way to separate your sources for different languages would be src/test/c, src/test/c++ and src/test/fortran, but any file under src/test is searched for. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software Now that the linker name is known all other properties are looked up with a prefix of [arch.[os.[linker.]]] from the AOL Properties file, but can be overridden in the configuration section

Once this logging change lives in an isolated commit, I'll be happy to merge it. 👍 montoyaedu referenced this issue Jul 8, 2013 Merged proposed enhancements for adding logging to NarUtil.runCommand. Not the answer you're looking for? nar-gnu-resources Copies the resourceIncludeDir (include) from the gunSourceDirectory (src/gnu) into the noarch area inside target. https://github.com/maven-nar/nar-maven-plugin/issues/24 These nar files can be installed in the local maven repository and deployed to a standard maven (web) server, using the standard maven-install-plugin and maven-deploy-plugin.

Apache > Maven > Plugins > Maven NAR Plugin NAR Plugin for Maven1 | Maven | Last Published: 2009-12-18 | Version: 2.1-SNAPSHOT Overview Introduction Philosophy Presentation (ppt) User Info Goals Usage Take a tour to get the most out of Samebug. If you'd still like to have some information in regards to the auto-detection not working properly, I'll gladly assist you. ctrueden added the needs-feedback label Aug 12, 2016 dproteus13 commented Aug 12, 2016 Also, as a last resort, you can specify the AOL via the tag inside the plugin's ,

In the example above, the workaround was easy: install the latest Xcode, go to Preferences > Downloads and install the command line tools. What does "there lived here then" mean? If you agree to our use of cookies, please close this message and continue to use this site. nar-javah This goal will run the javah tool on any class file in the javah.classDirectory directory that has native methods in it.

The jar and nar files only consists in their full form on the server and are never unpacked on the server. © 2002-2009 The Apache Software Foundation - Privacy Policy View Then you can file a PR for each one, and we can discuss the changes in the relevant PR instead of needing to post links in issues here. Using 3.2.0 gives me the exact same problem as the version I used to start this topic, unfortuantely. For a description see nar-dependencies.

Following are details about my environment: Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 22:51:28+0900) Maven home: C:\Program Files\apache-maven-3.0.5 Java version: 1.6.0_37, vendor: Sun Microsystems Inc. Will 87 * work in combination with . 88 * 89 * @parameter expression="" 90 */ 91 private String optionSet; 92 93 /** 94 * Clears default options 95 * 96 The problem is that link.exe /version does not return 0 but 1146 with the following message: Microsoft (R) Incremental Linker Version 10.00.30319.01 Copyright (C) Microsoft Corporation. The NAR plugin executes the following goals, in the order below, to create and deploy nar files.

The javah tool is picked up from the java installation and is run with a classpath of the javah.classDirectory and all depencies' classpaths, unless you specify a list in javah.classPaths. The jar file is created by the standard package goal. The standard maven dependency declaration in the POM is used to describe such dependencies of type "nar", see nar-dependencies.

the javah.jniDirectory.

We recommend upgrading to the latest Safari, Google Chrome, or Firefox. Will work in combination with . Reload to refresh your session. You signed in with another tab or window.

TBD If you set maven.nar.includefilesonly to true the compilation step will be skipped. LINK : fatal error LNK1146: no argument specified with option '/version' Maybe we need to change version detection for link.exe. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with Parameters:name152153publicLinker(Stringname)154{155this.name=name;156}157158publicfinalStringgetName()159{160returnname;161}162163publicfinalStringgetName(NarPropertiesproperties,Stringprefix)164throwsMojoFailureException,MojoExecutionException165{166if((name==null)&&(properties!=null)&&(prefix!=null))167{168name=properties.getProperty(prefix+"linker");169}170if(name==null)171{172thrownewMojoExecutionException("NAR:Oneoftwothingsmaybewronghere:\n\n"173+"1.tagismissinginsidethetagofyourNARconfiguration\n\n"174+"2.nolinkerisdefinedintheaol.propertiesfilefor'"+prefix+"linker'\n");175}176returnname;177}178179publicfinalStringgetVersion()180throwsMojoFailureException,MojoExecutionException181{182if(name==null)183{184thrownewMojoFailureException("Cannotdeducelinkerversionifnameisnull");185}186187Stringversion=null;188189TextStreamout=newStringTextStream();190TextStreamerr=newStringTextStream();191TextStreamdbg=newStringTextStream();192193if(name.equals("g++")||name.equals("gcc"))194{195NarUtil.runCommand("gcc",newString[]{"--version"},null,null,out,err,dbg);196Patternp=Pattern.compile("\\d+\\.\\d+\\.\\d+");197Matcherm=p.matcher(out.toString());198if(m.find())199{200version=m.group(0);201}202}203elseif(name.equals("msvc"))204{205NarUtil.runCommand("link",newString[]{"/version"},null,null,out,err,dbg);206Patternp=Pattern.compile("\\d+\\.\\d+\\.\\d+");207Matcherm=p.matcher(out.toString());208if(m.find())209{210version=m.group(0);211}212}213elseif(name.equals("icc")||name.equals("icpc"))214{215NarUtil.runCommand("icc",newString[]{"--version"},null,null,out,err,dbg);216Patternp=Pattern.compile("\\d+\\.\\d+");217Matcherm=p.matcher(out.toString());218if(m.find())219{220version=m.group(0);221}222}223elseif(name.equals("icl"))224{225NarUtil.runCommand("icl",newString[]{"/QV"},null,null,out,err,dbg);226Patternp=Pattern.compile("\\d+\\.\\d+");227Matcherm=p.matcher(err.toString());228if(m.find())229{230version=m.group(0);231}232}233elseif(name.equals("CC"))234{235 NarUtil.runCommand("CC",newString[]{"-V"},null,null,out,err,dbg);236 Patternp=Pattern.compile("\\d+\\.d+");237 Matcherm=p.matcher(err.toString());238 if(m.find())239 {240 version=m.group(0);241 }242}243else244{245thrownewMojoFailureException("Cannotfindversionnumberforlinker'"+name+"'");246}247248if(version==null){249 thrownewMojoFailureException("Cannotdeduceversionnumberfrom:"+out.toString());250}251returnversion;252}253254publicfinalLinkerDefgetLinker(AbstractCompileMojomojo,ProjectantProject,Stringos,Stringprefix,255Stringtype)256throwsMojoFailureException,MojoExecutionException257{258if(name==null)259{260thrownewMojoFailureException("NAR:Pleasespecifyaaspartof");261}262263LinkerDeflinker=newLinkerDef();264linker.setProject(antProject);265LinkerEnumlinkerEnum=newLinkerEnum();266linkerEnum.setValue(name);267linker.setName(linkerEnum);268269//incremental,map270linker.setIncremental(incremental);271linker.setMap(map);272273//Adddefinitions(Windowonly)274if(os.equals(OS.WINDOWS)&&(type.equals(Library.SHARED)||type.equals(Library.JNI)))275{276Setdefs=newHashSet();277try278{279ListcSrcDirs=mojo.getC().getSourceDirectories();280for(Iteratori=cSrcDirs.iterator();i.hasNext();)281{282Filedir=(File)i.next();283if(dir.exists())284{285defs.addAll(FileUtils.getFiles(dir,"**/*.def",null));286}287}288}289catch(IOExceptione)290{291}292try293{294ListcppSrcDirs=mojo.getCpp().getSourceDirectories();295for(Iteratori=cppSrcDirs.iterator();i.hasNext();)296{297Filedir=(File)i.next();298if(dir.exists())299{300defs.addAll(FileUtils.getFiles(dir,"**/*.def",null));301}302}303}304catch(IOExceptione)305{306}307try308{309ListfortranSrcDirs=mojo.getFortran().getSourceDirectories();310for(Iteratori=fortranSrcDirs.iterator();i.hasNext();)311{312Filedir=(File)i.next();313if(dir.exists())314{315defs.addAll(FileUtils.getFiles(dir,"**/*.def",null));316}317}318}319catch(IOExceptione)320{321}322323for(Iteratori=defs.iterator();i.hasNext();)324{325LinkerArgumentarg=newLinkerArgument();326arg.setValue("/def:"+i.next());327linker.addConfiguredLinkerArg(arg);328}329}330331//FIXME,thisshouldbedoneinCPPTasksatsomepoint,andmaynotbenecessary,butwasforVS2010beta2332if(os.equals(OS.WINDOWS)&&getName(null,null).equals("msvc")&&!getVersion().startsWith("6."))333{334LinkerArgumentarg=newLinkerArgument();335arg.setValue("/MANIFEST");336linker.addConfiguredLinkerArg(arg);337}338339//Addoptionstolinker340if(options!=null)341{342for(Iteratori=options.iterator();i.hasNext();)343{344LinkerArgumentarg=newLinkerArgument();345arg.setValue((String)i.next());346linker.addConfiguredLinkerArg(arg);347}348}349350if(optionSet!=null)351{352353String[]opts=optionSet.split("\\s");354355for(inti=0;i356{357358LinkerArgumentarg=newLinkerArgument();359360arg.setValue(opts[i]);361linker.addConfiguredLinkerArg(arg);362}363}364365if(!clearDefaultOptions)366{367Stringoption=NarProperties.getInstance(mojo.getMavenProject()).getProperty(prefix+"options");368if(option!=null)369{370String[]opt=option.split("");371for(inti=0;i372{373LinkerArgumentarg=newLinkerArgument();374arg.setValue(opt[i]);375linker.addConfiguredLinkerArg(arg);376}377}378}379380//recordthepreferencefornardependencylibrarylinkorder381if(narDependencyLibOrder!=null)382{383384ListlibOrder=newLinkedList();385386String[]lib=narDependencyLibOrder.split(",");387388for(inti=0;i389{390libOrder.add(lib[i].trim());391}392393mojo.setDependencyLibOrder(libOrder);394}395396//AddLibrariestolinker397if((libs!=null)||(libSet!=null))398{399400if(libs!=null)401{402403for(Iteratori=libs.iterator();i.hasNext();)404{405406Liblib=(Lib)i.next();407lib.addLibSet(mojo,linker,antProject);408}409}410411if(libSet!=null)412{413addLibraries(libSet,linker,antProject,false);414}415}416else417{418419StringlibsList=NarProperties.getInstance(mojo.getMavenProject()).getProperty(prefix+"libs");420421addLibraries(libsList,linker,antProject,false);422}423424//AddSystemLibrariestolinker425if((sysLibs!=null)||(sysLibSet!=null))426{427428if(sysLibs!=null)429{430431for(Iteratori=sysLibs.iterator();i.hasNext();)432{433434SysLibsysLib=(SysLib)i.next();435linker.addSyslibset(sysLib.getSysLibSet(antProject));436}437}438439if(sysLibSet!=null)440{441addLibraries(sysLibSet,linker,antProject,true);442}443}444else445{446447StringsysLibsList=NarProperties.getInstance(mojo.getMavenProject()).getProperty(prefix+"sysLibs");448449addLibraries(sysLibsList,linker,antProject,true);450}451452returnlinker;453}454455privatevoidaddLibraries(StringlibraryList,LinkerDeflinker,ProjectantProject,booleanisSystem)456{457458if(libraryList==null)459{460return;461}462463String[]lib=libraryList.split(",");464465for(inti=0;i466{467468String[]libInfo=lib[i].trim().split(":",3);469470LibrarySetlibrarySet=newLibrarySet();471472if(isSystem)473{474librarySet=newSystemLibrarySet();475}476477librarySet.setProject(antProject);478librarySet.setLibs(newCUtil.StringArrayBuilder(libInfo[0]));479480if(libInfo.length>1)481{482483LibraryTypeEnumlibType=newLibraryTypeEnum();484485libType.setValue(libInfo[1]);486librarySet.setType(libType);487488if(!isSystem&&(libInfo.length>2))489{490librarySet.setDir(newFile(libInfo[2]));491}492}493494if(!isSystem)495{496linker.addLibset(librarySet);497}498else499{500linker.addSyslibset((SystemLibrarySet)librarySet);501}502}503}504} Profile: Standard JRE Google AppEngine org.apache.maven.plugin.nar Linker Linker() : void Linker(String) : void addLibraries(String, LinkerDef, Project, boolean) : void getLinker(AbstractCompileMojo, Project, String,

Here is a sample configuration (from this project, which you will of course need to tweak to your needs): gcc **/*.c Parameter:expression="" default-value="false"Required:6667privatebooleanincremental=false; Enables or disables the production of a map file. The goals are part of the nar packaging/lifecycle, which inserts the nar goals into the standard lifecyle. Chances are this is an issue on my end, but I just don't know what's causing this.

Parameter:expression=""127128privateStringsysLibSet; Specifies the link ordering of libraries that come from nar dependencies. Instead, it suggested no AOL at all. Nar files get downloaded, unpacked and installed in the local maven repository, just like jar files are (apart from the unpacking). The following jar and nar files are created: -.jar, containing a property file describing the behaviour of the library and other nar files available.