XLdeploy: Not able to create a folder with correct name - xl-deploy

I have to create a folder inside a dar. I am using below code in my POM
<deployable>
<name>Test_APP_resource</name>
<scanPlaceholders>true</scanPlaceholders>
<targetPath>C:\jboss\bin\resource</targetPath>
<type>file.Folder</type>
<targetPathShared>true</targetPathShared>
<createTargetPath>true</createTargetPath>
<targetPathSharedSubDirectories>true</targetPathSharedSubDirectories>
<location>C:\jboss\bin\resource</location>
</deployable>
but when dar is creating I see only resource folder not Test_APP_resource.
Using below Deployit version
<groupId>com.xebialabs.deployit</groupId>
<artifactId>maven-deployit-plugin</artifactId>
<version>3.8.4</version>

Your location is probably not pointing to an actual folder. Also your maven-deployit-plugin version is certainly not supported anymore. You might want to upgrade to the xldeploy-maven-plugin version 6.0.x

Related

Quarkus uber/fat jar name: does not respect project.build.finalName in version 1.13.3.Final as doc suggests

I find that Quarkus uber/fat jar name is not controlled by project.build.finalName in version 1.13.3.Final, but by <quarkus.package.output-name> or property quarkus.package.output-name. Is this a bug?
The fast-jar indeed does not respect this proprerty because everything it generates is put into a dedicated directory with a fixed name.
If the uber-jar is not respecting the property,then yeah that's a bug and please report
Add the following properties
quarkus.package.type=uber-jar
quarkus.package.runner-suffix=runner
quarkus.package.output-name=custom_name_jar

Linking with a Windows library outside the build folder

Is there a way to link with a library that's not in the current package path.
This link suggests placing everything under the local directory. Our packages are installed in some repository elsewhere. I just want to specify the libpath to it on windows.
authors = ["Me"]
links = "CDbax"
[target.x86_64-pc-windows-gnu.CDbax]
rustc-link-lib = ["CDbax"]
rustc-link-search = ["Z:/Somepath//CPP/CDbax/x64/Debug/"]
root = "Z:/Somepath//CPP/CDbax/x64/Debug/"
But trying cargo build -v gives me
package `hello v0.1.0 (file:///H:/Users/Mushfaque.Cradle/Documents/Rustc/hello)` specifies that it links to `CDbax` but does not have a custom build script
From the cargo build script support guide, it seems to suggest that this should work. But I can see that it hasn't added the path. Moving the lib into the local bin\x68_64-pc-windows-gnu\ path works however.
Update
Thanks to the answer below, I thought I'd update this to give the final results of what worked on my machine so others find it useful.
In the Cargo.toml add
links = "CDbax"
build = "build.rs"
Even though there is no build.rs file, it seems to require it (?) otherwise complains with
package `xxx v0.1.0` specifies that it links to `CDbax` but does not have a custom build script
Followed by Vaelden answer's create a 'config' file in .cargo
If this is a sub crate, you don't need to put the links= tag in the parent crate, even though it's a dll; even with a 'cargo run'. I assume it adds the dll path to the execution environment
I think the issue is that you are mistaking the manifest of your project with the cargo
configuration.
The manifest is the Cargo.toml file at the root of your project. It describes your project itself.
The cargo configuration describes particular settings for cargo, and allow for example to override dependencies, or in your case override build scripts. The cargo configuration files have a hierarchical structure:
Cargo allows to have local configuration for a particular project or
global configuration (like git). Cargo also extends this ability to a
hierarchical strategy. If, for example, cargo were invoked in
/home/foo/bar/baz, then the following configuration files would be
probed for:
/home/foo/bar/baz/.cargo/config
/home/foo/bar/.cargo/config
/home/foo/.cargo/config
/home/.cargo/config
/.cargo/config
With this structure you can specify local configuration per-project,
and even possibly check it into version control. You can also specify
personal default with a configuration file in your home directory.
So if you move the relevant part:
[target.x86_64-pc-windows-gnu.CDbax]
rustc-link-lib = ["CDbax"]
rustc-link-search = ["Z:/Somepath//CPP/CDbax/x64/Debug/"]
root = "Z:/Somepath//CPP/CDbax/x64/Debug/"
to any correct location for a cargo configuration file, it should work.

Copying java source file from different maven project and modifying its package declaration

Suppose we have two different maven projects; project A and project B
Project B uses A and needs to dynamically (using maven pluggins ?) copy a source file "A.java" from project A, modify its package declaration and compile it (project B should have the same class from project A but with other package declaration ..)
I am trying to copy the source file from A to B before modifying the package declaration and compile all.
Is this the good approach ?
So, project A expose its java file as a resource
<build>
<resources>
<resource>
<directory>src/</directory>
<includes>
<include>**/A.java</include>
</includes>
</resource>
</resources>
</build>
But how can I copy this file to B (B is a dependency in A) ? does "maven-resources-plugin" enable to copy resources from a dependency project, and if so, how do I specify the property "directory" in "resource"
I tried by specify the location of the file in the jar dependency but it did not work
Do you have other propositions ?
Thanks
Finally I solved it by the following steps:
1 - Use "maven-dependency-plugin" to extract (unpack) what I want (the source files from the jar) of included artifacts.
2 - Use "maven-antrun-plugin" to execute ant commands, to replace the strings, create the new package and move modified sources ..
see here
3 - Use "build-helper-maven-plugin" to point the compiler to the new source package in order to include them in the compilation phase
PS: These three steps must happen in the phase "generate-sources" !
maven-resources-plugin enable you to copy java source anywhere before compiling (you can initialize phases) but the problem lies in package declaration in the java file. you need to modify it also and that is not simple in maven
But why you need to do so ? why you need to use the same code in two different packages ???

Slash in property name in pom.xml

I have a problem, what I cannot solve.
I want to build my eclipse cdo server with Tycho/Maven and also I want to have the prossibility to start my cdo-server.product out of eclipse.
The cdo server it set up like this: http://wiki.eclipse.org/Setting_up_a_CDO_Server
No there is my problem:
If I choose:
-Dnet4j.config="${resource_loc:/cdo.server/config}"
I can start it out of eclipse, but if I want to start the built CDO-Server.app it cannot find this folder.
If I choose:
-Dnet4j.config="../../../../../../../../../../cdo.server/config"
I can start the built CDO-Server.app, but I can't start it ou of eclipse.
This is all logical, but now I decided to make ${resource_loc:/cdo.server/config} as a property in my pom.xml file.
But if I write it like this:
<properties>
<resource_loc:/cdo.server/config>../../../../../../../../../../cdo.server/config</resource_loc:/cdo.server/config>
</properties>
I get the exception, that this is not a parseable POM because of the slash in the tag.
If I want to make it like this:
<properties>
<resource_loc:>
<cdo.server>
<config>../../../../../../../../../../cdo.server/config</config>
</cdo.server>
</resource_loc:>
</properties>
It also is not a parseable POM. Is there any possibility to use ${resource_loc:/cdo.server/config} as a property?
The problem in your property definition are the slashes in the name of the property.
The following will fail parsing the pom.xml:
<resource_loc:/cdo.server/config>yx</resource_loc:/cdo.server/config>
or
WhatEverValue
It will also not working if you try to use / as a replacement for the slash in the entity name.
you may want to try http://mojo.codehaus.org/properties-maven-plugin/read-project-properties-mojo.html to read the properties from a separate file instead in order to get around the XML well-formedness limitation in pom.xml.

Maven Assembly - copy just file from sub-folder when extracting from archive

I have a very specific requirement of our build infrastructure to copy some contents of another JAR dependency to a specific sub-folder of my web-application. We're using maven-assembly-plugin, and a natural way to do this is to use <dependencySet> along with <unpackOptions>.
The code sample (in assembly descriptor) I have looks as following:
<dependencySet>
<unpack>true</unpack>
<scope>runtime</scope>
<useProjectArtifact>false</useProjectArtifact>
<includes>
<include>my.group:artifact:jar</include>
</includes>
<unpackOptions>
<includes>
<include>subfolder/config.xml</include>
</includes>
</unpackOptions>
<outputDirectory>WEB-INF/otherfolder</outputDirectory>
</dependencySet>
The problem is that I can't figure out how to specify that I only want to copy just a single file artifact.jar/subfolder/config.xml to a target WEB-INF/otherfolder. The actual result is WEB-INF/otherfolder/subfolder/config.xml. As you can see, /subfolder gets appended to a final path. Is there any way to change the <include> expression so that /subfolder doesn't get appended?
Thanks in advance!
Have you ever thought about the maven-dependency-plugin which has a good support for unpacking archives.
Browsing through source reveals that this is not possible via maven-assembly plug-in. It gets all includes that are specified in assembly descriptor, and then passes this information to Plexus archiver which is used through multiple stages. Include patterns are passed to Plexus archiver as well, and then it obviously performs 'unpack' conserving directory structure.
As #khmarbaise indicates, the solution lies in combining dependency-plugin with assembly-plugin:
On package phase start by unpacking the dependencies you need to some target directory
On package (later in pom) use assembly to extract specific files from that directory into your artifact
Try this out with the <file/> tag and destName:
https://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_file

Resources