logo
down
shadow

Maven: How to unpack precise files from artifacts in the same output directory?


Maven: How to unpack precise files from artifacts in the same output directory?

By : user2953757
Date : November 21 2020, 01:01 AM
may help you . You could use the maven antrun plugin by using the copy task with the flatten option as it is described in the following thread: Maven : copy files without subdirectory structure
Best
code :


Share : facebook icon twitter icon
How to remove generated build artifacts from Maven's target directory?

How to remove generated build artifacts from Maven's target directory?


By : 格桑花
Date : March 29 2020, 07:55 AM
To fix this issue Just use the clean plugin and run an execution after the install phase:
code :
  <plugin>
    <artifactId>maven-clean-plugin</artifactId>
    <version>2.2</version>
    <executions>
      <execution>
        <id>auto-clean</id>
        <phase>install</phase>
        <goals>
          <goal>clean</goal>
        </goals>
        <configuration>
          <filesets>
            <fileset>
              <directory>${project.build.outputDirectory}</directory>
              <includes>
                <include>**/*.jar</include>
              </includes>
            </fileset>
           </filesets>
         </configuration>
      </execution>
    </executions>
  </plugin>
How to run a java application and uses its output to run maven artifacts?

How to run a java application and uses its output to run maven artifacts?


By : itay abulafia
Date : March 29 2020, 07:55 AM
I wish this help you I need to run a java application, if its output is "Passed" then I will run mvn site command. I have gone through several forums and got to know this can be done using pre-site goal but how will i validate the "Passed" state. The Java Application is a command that is used to invoke a Python script. If it runs successfully then output is passed. If i run from Hudson I can put the command in Pre-Build Step. But How will I validate if the output is passed or failed. Please help , From Jenkins's 'Execute Shell' help:
How to get maven dependency sources and unpack them to a specified directory?

How to get maven dependency sources and unpack them to a specified directory?


By : A.samuel
Date : March 29 2020, 07:55 AM
hop of those help? You could use the maven-eclipse-plugin plugin to download the sources, and give you a list of the source jars that are available (some of your dependencies might not have sources available).
The dependency plugin can also download sources, but it's harder to get the list of jars you need.
code :
dir=target/sources
mkdir -p $dir
mvn eclipse:eclipse -DdownloadSources
sed -rn '/sourcepath/{s/.*sourcepath="M2_REPO.([^"]*).*/\1/;p}' .classpath | \
  (cd $dir && xargs -i jar xf ~/.m2/repository/{})
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
  <classpathentry kind="output" path="target/classes"/>
  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
  <classpathentry kind="var" path="M2_REPO/net/sourceforge/findbugs/jsr305/1.3.7/jsr305-1.3.7.jar"/>
  <classpathentry kind="var" path="M2_REPO/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar" sourcepath="M2_REPO/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0-sources.jar"/>
</classpath>
How to unpack just the files from a sub-folder in maven-dependency-plugin with goal unpack-dependencies?

How to unpack just the files from a sub-folder in maven-dependency-plugin with goal unpack-dependencies?


By : user7791927
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further The Maven Dependency Plugin is made for dependencies, i.e. Java archives. The directory structure inside a Java archive is essential for the class files' package structure. So, it's easy to comprehed why the directories in your archive are considered by the plugin and cannot be suppressed.
The cleanest way I can think of at the moment is to copy the files afterwards. See Best practices for copying files with Maven.
Tell maven to copy artifacts from directory other than maven-repo

Tell maven to copy artifacts from directory other than maven-repo


By : user4557145
Date : March 29 2020, 07:55 AM
this one helps. Technically speaking the answer is no, you can't tell maven to get artifacts from an arbitrary folder. This is because the whole idea behind maven is that you can always reproduce your builds and you know exactly where all of your dependencies came from.
I would suggest you try maven-installing those other artifacts you have. That would pull them into your repository and maven will work fine from there. You could try to fool maven, but that kinda defeats the whole purpose of using maven.
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org