I'm trying to get JAWR working with the generator configuration to convert less into CSS post compile but I keep getting errors when I try where it's trying to go to a jawr_generator.css file as this is supported (if I'm reading the documentation correctly) in newer versions but I'm getting a 404 doesn't exist.
I'm using maven, spring, and JAWR (project requirement, yes I know grunt and other things can do what we're doing but I need it using these technologies). I'm not wanting to do this at compile time with the Pom files either because we want hot swapping without using the less plugin for intelliJ.
From what I'm reading all you have to do is have JAWR set up, include the less4j in your maven config along with JAWR (JAWR is already functioning from a compile time configuration) and change the resource to .less at the directory you're pointing to, does anyone have any idea what I'm missing?
applicable parts of pom (version of JAWR is 1.7.0.1.1 if I'm not mistaken, it's just not defined in this POM explicitly):
...
<dependency>
<groupId>com.github.sommeri</groupId>
<artifactId>less4j</artifactId>
<version>1.17.2</version>
</dependency>
...
<plugin>
<groupId>org.lesscss</groupId>
<artifactId>lesscss-maven-plugin</artifactId>
<configuration>
<sourceDirectory>ourSourceDirectoryPath</sourceDirectory>
<outputDirectory>targetPath/ourDirectory
</outputDirectory>
<includes>
<include>otherFileCompiledAtCompile.less</include>
</includes>
</configuration>
</plugin>
jawr.properties:
# fileName (note I've ripped out this from our actual names to make this generic)
jawr.js.bundle.bundleName.id=/bundles/fileName.js
jawr.js.bundle.bundleName.mappings=/path/js/fileName.js,/path/otherFileName.js
jawr.css.bundle.bundleName.id=/bundles/fileName.css
jawr.css.bundle.bundleName.mappings=/path/css/lib/fileName.less
Anyone have any ideas as to what I'm missing here? I've changed all the files and paths somewhat just for sanitization of data, it works fine when I put it in the pom. However if I try and get the resources to dynamically compile less to css at runtime it's saying this in the web browser developer tools debugger console and not showing the css file as being loaded:
Failed to http://ourUrl.com/path/jawr_generator.css?generationConfigParam=%2fpath%2fcss%2flib%2ffileName.less
load resource: the server responded with a status of 404 (Not Found)
The jawr_generator.css isn't a file we use, it seems to be a part of JAWR itself and doesn't get compiled/exist. I'm assuming I'm missing a configuration or a property somewhere to enable this, anyone have any ideas? Thanks in advance for any help.
We've resolved this, there was an issue with one of the paths where it was placing the file in a different directory than it was in the original file structure. Fixing this resolved the issue. The anltr conflict was a red herring. Closing as resolved.
When running a test using PHPStorm it loads a configuration from an other project.
/usr/bin/php /private/var/folders/jv/rch25xnj6y3cl_yf4s6qq64m0000gn/T/ide-phpunit.php --bootstrap /Users/reneterstegen/Sites/www.domain1.com/app/bootstrap.php.cache --configuration /Users/reneterstegen/Sites/www.one-of-my-other-projects.com/app/phpunit.xml.dist --filter "/::itLoadsTheForm( .*)?$/" Stegeman\Bundle\SearchBundle\Tests\SearchControllerTest /Users/reneterstegen/Sites/www.domain1.com/src/Stegeman/Bundle/SearchBundle/Tests/SearchControllerTest.php
This causes a fatal:
Class 'JMS\SerializerBundle\JMSSerializerBundle' not found in /Users/reneterstegen/Sites/www.one-of-my-other-projects.com/app/AppKernel.php on line 21
This makes sense since the project I am testing is nog using this bundle.
I've already set the default configuration file and default bootstrap file settings in the PHPUnit section in preferences.
Question: Can somebody tell me how to change the configuration used by phpunit in PHPStorm?
Can somebody tell me how to change the configuration used by phpunit in PHPStorm?
You can always specify custom ("alternative") config file per Run/Debug Configuration -- it will be used instead of Default one that you have set in Preferences.
https://confluence.jetbrains.com/display/PhpStorm/PHPUnit+support+in+PhpStorm#PHPUnitsupportinPhpStorm-3.CreatingaRunConfiguration
Here you have to tick the "Use alternative configuration file" and specify full path to it (either manually or via "..." button). NOTE: if you click on a button next to "..." one it will allow you to edit paths to Default config files (the ones from Preferences).
Please note that if you have defined your bootstrap file in that Default section as well .. it will also be used and AFAIK you cannot override it. It will be better if you provide bootstrap file in actual config file.
I am confused, I was working with symfony project, but out of nowhere this ".idea" directory was added to my project root directory, I have no clue what is generating it, but when I delete it keeps poping back after some interaction with my project like page request.
Also it might be worth to mention that I has following structure:
\.idea
\scopes
\scope_settings.xml
\project-name.iml (this is my project name)
\encodings.xml
\misc.xml
\modules.xml
\workspace.xml
and they contain something like this (scope_settings.xml) for example
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>
I searched my project for clues what may be creating this directory but only found gitignore of ".idea" directory inside vendor/common/doctrine
I would really like to find out what is this directory, and what it's purpose, and if possible how to get rid of it, for it's annoyance.
These files are project data/metadata created and used by Intellij IDEA.
It likely just means that you or someone has used IDEA to view or edit the code.
Is it possible to remove the commented lines from a web.config on build?
xml transform is fine to remove some elements but I couldn't find any syntax to clean the comments from the file.
We are using TFS 2010 build server for our builds.
<add xdt:Transform="RemoveAll" xdt:Locator="XPath(//comment())" />
Put this node within the root node of your transform file. "XPath(//comment())" selects all XML comment nodes to delete.
UPDATE: See actual and working answer below.
It's not possible to do with xml transformation.
But you can do it with your own console app or msbuild task.
See example code here Remove XML comments using Visual Studio 2010 Web Config Transformation
I had a similar problem where I wanted to remove dev comments from the config files before I published to the web site. I wrote an app that will recursively remove comments from config files in the directory I specify on the command line. The sample below assumes YourCommentRemover will do the same.
I included the comment remover project as part of my solution and referenced it in the web app I plan to deploy. You can just add the executable as a reference if you want. Since I didn't want the comment remover to get deployed, I added a task to delete it from the bin directory where it was being staged for deploy, (ProjectDir)obj\$(Configuration)\Package\PackageTmp\.
Open your project file in a text editor (You can right-click on the project file in the solution explorer and select 'Edit Project File').
Go to the very end of the project file and insert the following before </Project>:
<Target Name="BeforePublish" BeforeTargets="MSDeployPublish">
<Exec Command="$(ProjectDir)bin\YourCommentRemover $(ProjectDir)obj\$(Configuration)\Package\PackageTmp" />
<Exec Command="del $(ProjectDir)obj\$(Configuration)\Package\PackageTmp\bin\YourCommentRemover.*" />
</Target>
This target will run before any files are copied to the web application location on publish.
I am trying to publish a Website project from a vendor that has ridiculously long paths to some of its files. When publishing, the error is:
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
When I publish, Visual Studio 2012 Update 3 is attempting to write to a temp directory, and the prefix is quite long:
C:\Users\cuser\AppData\Local\Temp\WebSitePublish\MidasCMS400v9-1580334405\obj\Debug\Package\PackageTmp\
I thought I might be able to redirect VS to a different temporary directory at c:\tem by following this SO answer: Temp path too long when publishing a web site project
I create my publication profile, and as soon as I open it, there is an error indicating that WebPublishMethod is not an element of PropertyGroup. Regardless, I updated the file so it looks like this:
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>C:\Sites\MidasPublish</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
<AspnetCompileMergeIntermediateOutputPath>c:\tem\</AspnetCompileMergeIntermediateOutputPath>
</PropertyGroup>
</Project>
When I try to publish, I get the a modal box pop-up entitled "File Modification Detected", with the message "The project YourWebsite has been modified outside the environment", and it asks me if I want to reload. In my error list, I continue to get the error about the path being too long, as it is not attempting to use the c:\tem directory I identified.
I need to put this bloody thing onto a server, I am up for any solution that allows me to publish the bloody thing. I don't know much about the Website project template, so please let me know if there is a better way.
From http://forums.asp.net/t/1944241.aspx?Website+publish+failing+due+to+file+path+being+too+long
Add the following line in default PropertyGroup of web project file.
<IntermediateOutputPath>..\Temp\</IntermediateOutputPath>
You can likely make the above path C:\temp or ......\Temp (as needed to get it as close to root of the drive as possible.
In my case, there was no .csproj or .vbproj (website project file) but there was a website.publishproj file that warns you not to edit it, but I did anyway, and it did the trick.
Thanks to Stelvio, from http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2156195-fix-260-character-file-name-length-limitation , there is a solution :
Well, I found a workaround that ALLOW work with path with more than 260 chars.
Disclaimer: I've tried this trick only on Windows 8 x64 and Visual Studio 2013
So, to make it work I've just create a junction to the folder with the mklink command:
Assume this is the original path: d:\very\very\long\path\to\solution\folder, you can obtain a short link as d:\short_path_to_solution_folder just jaunching this command from a dos shell as administrator:
mklink /J d:\short_path_to_solution_folder d:\very\very\long\path\to\solution\folder
change source and destination path to you needs
Best Regards!
Stelvio
from this link :
http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2156195-fix-260-character-file-name-length-limitation
While moving the project closer to the root file does work. I found a link to a solution that did work for me. The site also does a great job at discussion the issue as well as the details behind his solution.
Sayed Hashimi's solution to long path issue
EDIT:
To Summarize the provided link:
You can update your publish profile file, which is used by MSBuild, to include a replace rule that will shorten the path of your output when publishing to a web deploy package (Zip file).
For example, let's say publishing using the default profile created by Visual Studio, we get the following paths in the zip file:
archive.xml
Content\C_C\Temp\package\WebApplication1\obj\Release\Package\PackageTmp
Content\C_C\Temp\package\WebApplication1\obj\Release\Package\PackageTmp\bin
Content\C_C\Temp\package\WebApplication1\obj\Release\Package\PackageTmp\bin\WebApplication1.dll
Content\C_C\Temp\package\WebApplication1\obj\Release\Package\PackageTmp\index.html
Content\C_C\Temp\package\WebApplication1\obj\Release\Package\PackageTmp\Web.config
parameters.xml
systemInfo.xml
The trick is to replace all of the path defined after Content with a shorter path. In this particular example, replace the path with "website" in the PackagePath element.
One can edit the publishing profile file (.pubxml) and add the follow lines near the end of the file, just before the Project element is terminated.
<PropertyGroup>
<PackagePath Condition=" '$(PackagePath)'=='' ">website</PackagePath>
<EnableAddReplaceToUpdatePacakgePath Condition=" '$(EnableAddReplaceToUpdatePacakgePath)'=='' ">true</EnableAddReplaceToUpdatePacakgePath>
<PackageDependsOn>
$(PackageDependsOn);
AddReplaceRuleForAppPath;
</PackageDependsOn>
</PropertyGroup>
<Target Name="AddReplaceRuleForAppPath" Condition=" '$(EnableAddReplaceToUpdatePacakgePath)'=='true' ">
<PropertyGroup>
<_PkgPathFull>$([System.IO.Path]::GetFullPath($(WPPAllFilesInSingleFolder)))</_PkgPathFull>
</PropertyGroup>
<!-- escape the text into a regex -->
<EscapeTextForRegularExpressions Text="$(_PkgPathFull)">
<Output TaskParameter="Result" PropertyName="_PkgPathRegex" />
</EscapeTextForRegularExpressions>
<!-- add the replace rule to update the path -->
<ItemGroup>
<MsDeployReplaceRules Include="replaceFullPath">
<Match>$(_PkgPathRegex)</Match>
<Replace>$(PackagePath)</Replace>
</MsDeployReplaceRules>
</ItemGroup>
</Target>
Now, the publish profile paths should look something like the following:
archive.xml
Content\website
Content\website\bin
Content\website\bin\WebApplication1.dll
Content\website\index.html
Content\website\Web.config
parameters.xml
systemInfo.xml
The answer of Jason Beck worked to me with a small change. To avoid the error "The IntermediateOutputPath must end with a trailing slash." use the "\" at the end of the path:
..\Temp\
Your "CONFIG_PUBLISH_FILE.pubxml" should look like this (The "..." omits other configuration that you file may have):
...
...
..\Temp\
...
At the time of publishing the project, the visual studio compiler checks the size of the files that are part of the project.
So I searched for long names in files.
I found and renamed those files.
Did Work perfectly
In my case it was because the default legacy string length limitation of windows. This was still set to 256-character limit.
To fix this, from an admin powershell session I ran the following command
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
I needed to reboot the system for the changes to take effect.
Microsoft reference document link here
This error comes because of long path name....U just cut your folder from current location to D drive or F drive. suppose your project folder name is "myproject", and you should cut this folder and paste to D drive of F drive,that your current path name will be D:\myproject or F:\myproject. Then you publish again......It will work...