I have a project structure like:
Web Pages
|
|----WEB-INF
|----js
|----css
|----dist
|----other files
I want to remove all the files and folders except the WEB-INF folder and also copy the contents from dist folder directly into the Web Pages and then remove the dist folder as well during the build process.
I have tried maven-war-plugin but I am not able to do it.
Related
Copy files from artifacts to a folder
I am using Azure Devops Deployment group job to copy some files to the server
The 2 steps I am following are 1. Stop a Windows service using Powershell and looks OK
Then using CopyFiles task to copy the files from the Artifacts location
The artifcat is a zip file and the location is mapped correctly
I have to unzip the contents of the zip file and move to the target folder
Or move the zip file to the target folder and unzip the file contents after its copied
But the CopyFiles task is not copying any files [ I tried various combinations in Contents property to include zip extension etc but no luck]
Is any of the steps are missing or i am doing wrong? The screen shot of PIpeline is like below
Based on your requirement, you need to unzip the contents of the zip file and copy files.
I suggest that you can use Extract files to unzip the zip file.
In Copy files task, you don't need to specify a specific zip file in the source folder. You just need to specify the folder path where the files are located.
Here is an example: $(system.defaultworkingdirectory)/_Data Cloud Service Live/service
In my web app folder, i have created symLinks for some of the files and folders. When I use mvn war:war plugin they are actually copying the files and folders instead of symlink.
I want symLinks should be copied instead of actual files and folders. Is there any way by which we can achieve the same.
Previously we made a Gradle project in Intellij and all the gradle files were there under the project. However, we have now moved the files in this project to a sub folder, but the Gradle files aren't being recognised. The picture below is the new folder set up where our code from the original project is now in the server folder (where the Gradle files are). When I mark the src folder (under server) as the Sources Root, that is when the dependencies from Gradle aren't recognised.
I figured out that the correct way to go is actually to separate out the client/server folder into two separate modules.
I have a build that needs to zip a website project. I am using TfsBuildExtensions.Activities.Compression.Zip to do this.
Unfortunately, it puts the deployed files into ..\_PublishedWebsites\ProjectName\.
So, I have tried to play around with the RemoveRoot property, in the ZIP extension.
If I use the following value:
(New DirectoryInfo(BinariesDirectory & "\_PublishedWebsites")).FullName my zip file contains the ProjectName folder and it then contains the website. Working as intended.
If I use the following value:
(New DirectoryInfo(BinariesDirectory & "\_PublishedWebsites")).GetDirectories().FirstOrDefault().FullName my zip file contains the ENTIRE folder structure, from C:\Builds\... This is definitely not what I expected.
All I want, is that instead of having a folder in my zip, I want the deployed files directly in the zip files root.
How do I do this?
Web Deploy should be your first choice for packaging web sites.
It has a built-in option for zipping the artifacts so you don't need any third-party libraries for this.
I have a mavenized project with jar packaging, have standard layout:
/src/main/java
/src/main/resources
When I execute: mvn package
I am expecting the resulting jar (non-executing) file to include the resources folder and everything inside that folder from the project(i.e. some xml files), but when I open the
jar file I only see the com folder where and the contents of the resources folder in the top level...
I think the above is default for maven3, but I want to include the resources folder in the jar file...
You will not see src/main/resources in resulted jar file.
You will only see the contents of src/main/resources in the jar file.
So, if you did not create a package structure for your resource files and dumped everything into src/main/resources directory, you will see your resource files at the top level of your jar.
If you want your resources appear under certain directory in the resulting jar file, create such a directory under src/main/resources tree.