Each one of my eclipse workspaces contains a 2.5GB cache inside the org.eclipse.m2e.core plugin directory. Is there any way this can be shared across workspaces?
(I have about 30 workspaces, out of necessity)
Regarding to the https://maven.apache.org/settings.html, I provide the dedicated directory for <localRepository> as the following example
The ${user.home}/.m2/settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd"
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<localRepository>path/to/repository</localRepository>
<settings>
Note: I use the Eclipse for Windows the menu may be different from your.
The Eclipse m2e configuration is as the following: -
Create new clean workspace.
Goto Windows --> Preferences, the system will display the Preferences dialog.
At the Preferences dialog, choose Maven --> User Settings.
At the right panel
Set the User Settings text box to ${user.home}/.m2/settings.xml.
Press the button named Update Settings
The text box named Local Repository (From merged user and global settings) should display the path path/to/repository as same as the value from tag <localRepository>.
Create new maven project
Monitor the org.eclipse.m2e.core, the size should be reduced.
I have a number of *.txt files included in my Visual Studio 2017 C++ project (*.vcxproj). Does anyone know how to get Visual Studio to copy these files to the output directory?
I found a similar question for VS 2010, but that answer doesn't work in Visual Studio 2017.
In the *.vcxproj file, change:
<Text Include="Filename.txt" />
to:
<Content Include="Filename.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Then in the *.vcxproj.filters file, change:
<Text Include="Filename.txt">
<Filter>Resource Files</Filter>
</Text>
to:
<Content Include="Filename.txt">
<Filter>Resource Files</Filter>
</Content>
Update for 2019 users:
An easy way to do this is from the file's Property Pages (right-click on the file in Solution Explorer, then click Properties).
Under Configuration Properties > General, change Item Type to "Copy file." By default, this will create a copy of the file in the build destination directory. Once you hit Apply, a new property page called Copy File will appear on the left where you can customize this behavior.
In a VS2019 c++ console project it was just a litlle different:
<ItemGroup>
<None Include="Run.bat">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</DeploymentContent>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
We use a custom location for our packages folder which we specify in a nuget.config file in the same folder as our solution:
<settings>
<repositoryPath>..\..\lib\packages</repositoryPath>
</settings>
Visual Studio 2013 picks this up fine and the NuGet package manager installs packages into the specified folder, lists installed packages correctly, etc.
In Visual Studio 2015 RC the NuGet package manager pops up the "Some packages are missing from this solution, click here to restore" message and if I click the button it creates a new packages folder in the same folder as the solution rather than using the location specified in the nuget.config. Installing a completely new package also puts it into a packages folder under the solution folder rather than the specified one.
How do I get Visual Studio 2015 RC to respect the repository path specified in the nuget.config?
Make sure your nuget.config is configured like this:
<configuration>
<config>
<add key="repositoryPath" value="..\..\lib\packages" />
</config>
</configuration>
I filed this bug with NuGet: https://github.com/NuGet/Home/issues/626
A fix has been made but I'm not sure when it will be released.
I am writing a website in VS2015 using the ASP.NET Preview template. Unfortunately, Dropbox has added a bunch of .dropbox.attr files in each folder of my project, which the Solution Explorer is displaying:
Note that I have not added them to the project manually, (they are not referenced in my Web.xproj,) and I do not have "Show All Files" selected. I have already added them to my .gitignore. There is no "Remove" option when selecting the file:
Lastly, I have tried adding them to my project.json's exclude section:
...
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc",
".dropbox.attr"
],
"exclude": [
"wwwroot",
"node_modules",
"bower_components",
".dropbox.attr"
]
...
Is there any way to get all files with this name to not appear in my Solution Explorer?
I'm not sure exactly of the interaction between VS2015 and the new project structure, so it could be a result of any of those factors.
You can modify the .xproj file of your project and add the following to exclude folders:
<ItemGroup>
<DnxInvisibleFolder Include="wwwroot\jspm_packages\" />
<DnxInvisibleFolder Include="wwwroot\node_modules\" />
<DnxInvisibleContent Include="wwwroot\tsd.json" />
</ItemGroup>
You can use DnxInvisibleFolder for folders and DnxInvisibleContent for files.
Some folders (like node_modules) have sometimes thousands of folders/files which seem to pose a major problem for VS2015 to scan and load.
In a DNX project in visual Studio 2015 the solution explorer does not use the project.json to determine what is shown. The "exclude" properties in project.json are used by dnx to determine which folders/files should be excluded from compilation or publishing but this does not affect Visual Studio's solution explorer.
Generally speaking "everything" is shown but that isn't exactly true as VS excludes certain folders (such as .git, .vs, artifacts, etc). It also adds back others (i.e. bower components is excluded by default from compilation but VS adds it back as a meta folder under dependencies). The "filter" for Solution Explorer is not exposed to the user so it can't be edited or changed by configuration file.
Your best bet would be to request via user voice that some method of configuration be added. Really the functionality is already there it just needs to be made customizable by the user.
With the latest Visual Studio you just need to right-click the folder/file and chose "Hide from Solution Explorer".
That will change the "xproj" this way like Corneliu wrote before:
<ItemGroup>
<DnxInvisibleFolder Include="wwwroot\" />
</ItemGroup>
I have Eclipse Luna and Maven 3.2.3 installed on a Windows 7 machine behind a corporate firewall.
Trying to create a project from an archetype results in the following error:
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-
quickstart:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-quickstart/maven-metadata.xml in local (C:\Users\xxxx.m2\repository)
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-quickstart/maven-metadata.xml in local (C:\Users\xxxx.m2\repository)
Proxy details are configured in .m2/settings.xml and generating a maven project from an archtype works fine in command line.
I tried to apply the solutions from here but none worked. The remote catalog is not acessible as well. I reckon it's a problem with the network settings of Eclipse. I also looked at this bug report to try and find some clues and couldn't really understand how to implement the workaround.
here is my settings.xml file:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>nexus</id>
<username>xxxx#xxxx.com</username>
<password>{XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}</password>
</server>
<server>
<id>deployment</id>
<username>xxxx#xxxx.com</username>
<password>{XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}</password>
</server>
</servers>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>https://nexus-int.xxxx.xxxx.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
Any ideas?
Thanks
Tomer
Same problem here, solved.
I will explain the problem and the solution, to help others.
My software is:
Windows 7
Eclipse 4.4.1 (Luna SR1)
m2e 1.5.0.20140606-0033
(from eclipse repository: http://download.eclipse.org/releases/luna)
And I'm accessing internet through a proxy.
My problem was the same:
Just installed m2e, went to menu: File > New > Other > Maven > Maven project > Next > Next.
Selected "Catalog: All catalogs" and "Filter: maven-archetype-quickstart", then clicked on the search result, then on button Next.
Then entered "Group Id: test_gr" and "Artifact Id: test_art", then clicked on Finish button.
Got the "Could not resolve archetype..." error.
After a lot of try-and-error, and reading a lot of pages, I've finally found a solution to fix it. Some important points of the solution:
It uses the default (embedded) Maven installation (3.2.1/1.5.0.20140605-2032) that comes with m2e.
So no aditional (external) Maven installation is required.
No special m2e config is required.
The solution is:
Open eclipse.
Restore m2e original preferences (if you changed any of them): Click on menu: Window > Preferences > Maven > Restore defaults. Do the same for all tree items under "Maven" item: Archetypes, Discovery, Errors/Warnings, Instalation, Lifecycle Mappings, Templates, User Interface, User Settings. Click on "OK" button.
Copy (for example to a notepad window) the path of the user settings file. To see the path, click again on menu: Window > Preferences > Maven > User Settings, and the path is at the "User settings" textbox. You will have to write the path manually, since it is not posible to copy-and-paste. After coping the path to the notepad, don't close the Preferences window.
At the Preferences window that is already open, click on the "open file" link. Close the Preferences window, and you will see the "settings.xml" file already openned in a Eclipse editor.
The editor will have 2 tabs at the bottom: "Design" and "Source". Click on "Source" tab. You will see all the source code (xml).
Delete all the source code: Click on the code, press control+a, press "del".
Copy the following code to the editor (and customize the uppercased values):
<settings>
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>YOUR.PROXY.IP.OR.NAME</host>
<port>YOUR PROXY PORT</port>
<username>YOUR PROXY USERNAME (OR EMPTY IF NOT REQUIRED)</username>
<password>YOUR PROXY PASSWORD (OR EMPTY IF NOT REQUIRED)</password>
<nonProxyHosts>YOUR PROXY EXCLUSION HOST LIST (OR EMPTY)</nonProxyHosts>
</proxy>
</proxies>
</settings>
Save the file: control+s.
Exit Eclipse: Menu File > Exit.
Open in a Windows Explorer the path you copied (without the filename, just the path of directories).
You will probaly see the xml file ("settings.xml") and a directoy ("repository"). Remove the directoy ("repository"): Right click > Delete > Yes.
Start Eclipse.
Now you will be able to create a maven project: File > New > Other > Maven > Maven project > Next > Next, select "Catalog: All catalogs" and "Filter: maven-archetype-quickstart", click on the search result, then on button Next, enter "Group Id: test_gr" and "Artifact Id: test_art", click on Finish button.
Finally, I would like to give a suggestion to m2e developers, to make config easier. After installing m2e from the internet (from a repository), m2e should check if Eclipse is using a proxy (Preferences > General > Network Connections). If Eclipse is using a proxy, the m2e should show a dialog to the user:
m2e has detected that Eclipse is using a proxy to access to the internet.
Would you like me to create a User settings file (settings.xml) for the embedded
Maven software?
[ Yes ] [ No ]
If the user clicks on Yes, then m2e should create automatically the "settings.xml" file by copying proxy values from Eclipse preferences.
For me the solution was a bit simpler, I just had to clean the repository : .m2/repository/org/apache/maven/archetypes
Just delete the ${user.home}/.m2/repository/org/apache/maven/archetypes to refresh all files needed, it worked fine to me!
In my case following solution worked.
Delete RELEASE directory & resolver-status.properties file in your local Maven repository under directory .m2/../maven-archetype-quickstart.
Create Maven project in Eclipse or STS (Spring Tool Suite). It will automatically download quickstart archetype & work as expected.
I hope this may help someone.
I GOT THIS problem too, and I solved it finally, this is the solution:
go to windows-->preference-->maven-->user settings
Change the settings.xml path to a valid path.
The path maybe not under .m2 directory (in your home directory)..
It's actually easy and straight forward.
just navigate to your .m2 folder.
.m2/repository/org/apache/maven
inside this maven folder, you will see a folder called Archetypes... delete this folder and the problem is solved.
but if you don't feel like deleting the whole folder, you can navigate into the archetype folder and delete all the archetype you want there. The reason why it keeps failing is because, the archetype you are trying to create is trying to tell you that she already exists in that folder, hence move away...
summarily, deleting the archetype folder in the .m2 folder is the easiest solution.
I had the same error show up while creating the project but I wasn't behind a proxy and hence the above solutions did not work for me.
I found this forum. It suggested to:
Delete or Rename .m2 directory from your HOME directory
In Windows - C:\Users\<username>\Windows
OR
In Linux - /home/<username>
restart the Eclipse / STS spring tool suite (which am using)
It worked!
I am using Spring STS 3.8.3. I had a similar problem. I fixed it by using information from this thread And also by fixing some maven settings. click Spring Tool Suite -> Preferences -> Maven and uncheck the box that says "Do not automatically update dependencies from remote depositories" Also I checked the boxes that say "Download Artifact Sources" and "download Artifact javadoc".
If you're behind a proxy, the very first thing to do is, add settings.xml with proxy configs under C:\Users\{username}\.m2 folder, and replicate same proxy configs under Window > Preferences > Network Connections (you may need to prefix your user name with domain eg. DOMAIN\username):
<settings>
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>webproxy.net</host>
<port>8080</port>
<username>username</username>
<password>password</password>
<nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
</proxy>
<proxy>
<active>true</active>
<protocol>https</protocol>
<host>webproxy.net</host>
<port>8080</port>
<username>username</username>
<password>password</password>
<nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
</proxy>
</proxies>
Delete C:\Users\{username}\.m2\repository folder as well.
It worked for = I just removed "archetypes" folder from below location
C:\Users\Lenovo.m2\repository\org\apache\maven
But you may change following for experiment - download latest binary zip of Maven, add to you C:\ drive and change following....
Change Proxy
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username></username>
<password></password>
<host>10.23.73.253</host>
<port>8080</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
Today this issue, consumed nearly entire day of mine. Hence, thought to share learning if it can save time of others.
It seems Eclipse Luna had issue. I tried bunch of things, but problem remain unresolved with Eclipse Luna.
Subsequently, I tried Eclipse Neon and problem is auto-resolved with Neon. It seems when the issue was posted here (as it's quite old), Neon version may not have been released.
So in summary, If anyone is yet using Java-8, Maven than by using Eclipse Neon you should not face an issue.
Also, what I learnt is that Maven-be it embedded (Internal to Eclipse) or external (which we install separately) don't make any difference here.
So now my working stack - JDK 8, Maven 3, Eclipse Neon
Ref: Eclipse Neon link for download - https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/neon/3/eclipse-jee-neon-3-win32-x86_64.zip
PS - Also, I tried latest version of Eclipse (R) named as "eclipse-jee-2021-03-R-win32-x86_64", however it requires minimal version as Java-11, so for Java 8 we can't use it.