logo
down
shadow

Maven Dependency execution directory


Maven Dependency execution directory

By : user2955397
Date : November 22 2020, 10:40 AM
seems to work fine This turned out to be within the Maven repo, not the Jenkins workspace.
code :


Share : facebook icon twitter icon
ignore maven dependency during specific execution phase

ignore maven dependency during specific execution phase


By : Ken Kuhlman
Date : March 29 2020, 07:55 AM
should help you out I got around this by using a seperate .m2/settings-eclipse.xml (for eclipse) where I over-ride the default type of dependency. so in my launcher POM, I have:
code :
<dependency>
  <groupId>com.myco</groupId>
  <artifactId>my-server</artifactId>
  <version>${project.version}</version>

  <!-- here we want eclipse to see "jar" but command line to see "war" -->
  <type>${jetty.launcher.workaround}</type>
</dependency>
Maven extract Dependency without creating dependency directory

Maven extract Dependency without creating dependency directory


By : Ghatak443
Date : March 29 2020, 07:55 AM
Hope this helps Unfortunately the maven-dependency-plugin unpack goal has not a postprocess optional parameter letting you, for example, chmod-ing or moving files. So I don't think exists an elegant way to do what you want only using the maven-dependency-plugin.
In addition to the maven-dependency-plugin you might use the maven-antrun-plugin, binding it to a subsequent phase which the maven-dependency-plugin is binded to, to copy/move/delete your files and directories.
Transitive Maven dependency shows up in dependency:tree but not in lib directory

Transitive Maven dependency shows up in dependency:tree but not in lib directory


By : renu
Date : March 29 2020, 07:55 AM
wish of those help I am running with maven 3.1.1 and the dependency spring-expressionis correctly added to WEB-INF/lib. The effective pom does not contain spring-expression, but that is normal as the effective pom does not resolve transitive dependencies.
The effective pom is just a merged xml file with the current pom plus all it's parents merged together. The maven dependency resolution mechanism is applied only after the effective pom is built.
code :
INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ test-project ---
[INFO] org.test.project:test-project:war:0.1-SNAPSHOT
[INFO] \- org.springframework:spring-context:jar:3.2.4.RELEASE:runtime
[INFO]    +- org.springframework:spring-aop:jar:3.2.4.RELEASE:runtime
[INFO]    |  \- aopalliance:aopalliance:jar:1.0:runtime
[INFO]    +- org.springframework:spring-beans:jar:3.2.4.RELEASE:runtime
[INFO]    +- org.springframework:spring-core:jar:3.2.4.RELEASE:runtime
[INFO]    |  \- commons-logging:commons-logging:jar:1.1.1:runtime
[INFO]    \- org.springframework:spring-expression:jar:3.2.4.RELEASE:runtime
aopalliance-1.0.jar
commons-logging-1.1.1.jar
spring-aop-3.2.4.RELEASE.jar
spring-beans-3.2.4.RELEASE.jar
spring-context-3.2.4.RELEASE.jar
spring-core-3.2.4.RELEASE.jar
spring-expression-3.2.4.RELEASE.jar
error when including dependency within the plugin under execution in maven

error when including dependency within the plugin under execution in maven


By : BlueChili
Date : March 29 2020, 07:55 AM
I wish this help you As mentions at "Guide to Configuring Plug-ins: Using the dependencies Tag", The dependencies tags is only available at the plugin level, not at the execution level as the following example: -
code :
<build>
    <plugins>
        <plugin>
            <groupId>some-group</groupId>
            <artifactId>some-artifact</artifactId>
            <version>some-version</version>
            ...
            <dependencies>
                <dependency>
                    <groupId>some-dependency-group</groupId>
                    <artifactId>some-dependency-artifact</artifactId>
                    <version>some-dependency-version</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>
How to use execution pointcut with third-party maven dependency?

How to use execution pointcut with third-party maven dependency?


By : Joanna Siwiec
Date : March 29 2020, 07:55 AM
should help you out I was a bit curious and set up a sample project with an aspect intercepting call(WebElement WebDriver+.findElement(*)) (similar to your approach) and also call(void WebElement+.click()). I used a sample page with an inline frame (iframe) from W3schools in order to emulate a few WebDriver exceptions such as NoSuchElementException and StaleElementReferenceException. This is easy if you just switch the focus from the main frame to an iframe and try to access an element from the former (or vice versa).
My sample aspect does not wait for n seconds, but iterates over the main and all iframes in order to re-issue the original call in that context. It should be very easy to adapt the sample code to your needs.
code :
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>de.scrum-master.stackoverflow</groupId>
    <artifactId>selenium-aspectj-retry</artifactId>
    <version>1.0-SNAPSHOT</version>

    <name>Selenium auto-retry via AspectJ</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.source-target.version>1.8</java.source-target.version>
        <aspectj.version>1.8.7</aspectj.version>
        <main-class>de.scrum_master.app.Application</main-class>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                    <configuration>
                        <source>${java.source-target.version}</source>
                        <target>${java.source-target.version}</target>
                        <!-- IMPORTANT -->
                        <useIncrementalCompilation>false</useIncrementalCompilation>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>aspectj-maven-plugin</artifactId>
                    <version>1.8</version>
                    <configuration>
                        <!--<showWeaveInfo>true</showWeaveInfo> -->
                        <source>${java.source-target.version}</source>
                        <target>${java.source-target.version}</target>
                        <Xlint>ignore</Xlint>
                        <complianceLevel>${java.source-target.version}</complianceLevel>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <!--<verbose>true</verbose> -->
                        <!--<warn>constructorName,packageDefaultMethod,deprecation,maskedCatchBlocks,unusedLocals,unusedArguments,unusedImport</warn> -->
                    </configuration>
                    <executions>
                        <execution>
                            <!-- IMPORTANT -->
                            <phase>process-sources</phase>
                            <goals>
                                <goal>compile</goal>
                                <goal>test-compile</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.aspectj</groupId>
                            <artifactId>aspectjtools</artifactId>
                            <version>${aspectj.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.4.0</version>
                    <configuration>
                        <mainClass>${main-class}</mainClass>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.dstovall</groupId>
                    <artifactId>onejar-maven-plugin</artifactId>
                    <version>1.4.4</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>one-jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <onejarVersion>0.96</onejarVersion>
                        <mainClass>${main-class}</mainClass>
                        <attachToBuild>true</attachToBuild>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
            </plugin>
            <!--
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <configuration>
                    <mainClass>${main-class}</mainClass>
                    <cleanupDaemonThreads>false</cleanupDaemonThreads>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.dstovall</groupId>
                <artifactId>onejar-maven-plugin</artifactId>
                <configuration>
                    <mainClass>${main-class}</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <pluginRepositories>
        <pluginRepository>
            <id>OneJAR googlecode.com</id>
            <url>http://onejar-maven-plugin.googlecode.com/svn/mavenrepo</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjrt</artifactId>
                <version>${aspectj.version}</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
                <version>2.48.2</version>
            </dependency>
            <dependency>
                <groupId>io.github.bonigarcia</groupId>
                <artifactId>webdrivermanager</artifactId>
                <version>1.3.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
        </dependency>
        <dependency>
            <groupId>io.github.bonigarcia</groupId>
            <artifactId>webdrivermanager</artifactId>
        </dependency>
    </dependencies>

    <organization>
        <name>Scrum-Master.de - Agile Project Management</name>
        <url>http://scrum-master.de</url>
    </organization>

</project>
package de.scrum_master.app;

import io.github.bonigarcia.wdm.ChromeDriverManager;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

import java.io.Closeable;
import java.io.IOException;

public class Application implements Closeable {
    private final WebDriver driver;

    public Application() {
        ChromeDriverManager.getInstance().setup();
        driver = new ChromeDriver();
    }

    @Override
    public void close() {
        driver.quit();
    }

    public WebDriver getDriver() {
        return driver;
    }

    public void doSomething() {
        driver.get("http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_type_hidden");

        // Button in main frame
        WebElement button = driver.findElement(By.className("seeResult"));
        // Text field in iframe
        driver.findElement(By.name("fname"));
        // Text area in main frame
        driver.findElement(By.id("textareaCode"));
        // Hidden input field in main frame
        driver.findElement(By.name("bt"));
        // Hidden input field in iframe
        WebElement hiddenCountryField = driver.findElement(By.name("country"));

        // Click button in main frame. This *refreshes* the iframe, making all existing
        // references to elements therein (e.g. 'hiddenCountryField') stale
        button.click();

        // Get value of hidden input field after iframe refresh
        System.out.println(driver.findElement(By.name("country")).getAttribute("value"));

        // This alternative would *not* work because the aspect cannot repair a reference
        // to an element which is gone forever because the iframe was refreshed
        // System.out.println(hiddenCountryField.getAttribute("value"));

        // Click submit button in iframe (triggers both advices)
        driver.findElement(By.cssSelector("input[type=submit]")).click();
    }

    public static void main(String[] args) {
        try (Application application = new Application()) {
            application.doSomething();
        }
    }
}
package de.scrum_master.aspect;

import de.scrum_master.app.Application;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

public aspect IFrameSwitcher {
    WebElement around(WebDriver driver, By by) :
        !within(IFrameSwitcher) &&
            call(WebElement WebDriver+.findElement(*)) &&
            target(driver) &&
            args(by)
        {
            System.out.println(thisJoinPoint + " -> " + by);
            WebElement webElement;
            try {
                System.out.print("  Trying main frame -> ");
                driver.switchTo().defaultContent();
                webElement = proceed(driver, by);
                System.out.println("OK");
                return webElement;
            }
            catch (RuntimeException e) {
                System.out.println(e.getClass().getSimpleName());
                for (WebElement iframe : driver.findElements(By.tagName("iframe"))) {
                    try {
                        System.out.print("  Trying iframe " + iframe.getAttribute("id") + " -> ");
                        driver.switchTo().frame(driver.findElement(By.id("iframeResult")));
                        webElement = proceed(driver, by);
                        System.out.println("OK");
                        return webElement;
                    }
                    catch (RuntimeException e2) {
                        System.out.println(e2.getClass().getSimpleName());
                        e = e2;
                    }
                }
                throw e;
            }
        }

    void around(Application application, WebElement webElement) :
        within(Application) &&
        call(void WebElement+.click()) &&
        this(application) &&
        target(webElement)
    {
        System.out.println(thisJoinPoint + " -> " + webElement);
        WebDriver driver = application.getDriver();
        try {
            System.out.print("  Trying main frame -> ");
            driver.switchTo().defaultContent();
            proceed(application, webElement);
            System.out.println("OK");
        }
        catch (RuntimeException e) {
            System.out.println(e.getClass().getSimpleName());
            for (WebElement iframe : driver.findElements(By.tagName("iframe"))) {
                try {
                    System.out.print("  Trying iframe " + iframe.getAttribute("id") + " -> ");
                    driver.switchTo().frame(driver.findElement(By.id("iframeResult")));
                    proceed(application, webElement);
                    System.out.println("OK");
                    return;
                }
                catch (RuntimeException e2) {
                    System.out.println(e2.getClass().getSimpleName());
                    e = e2;
                }
            }
            throw e;
        }
    }
}
call(WebElement org.openqa.selenium.WebDriver.findElement(By)) -> By.className: seeResult
  Trying main frame -> OK
call(WebElement org.openqa.selenium.WebDriver.findElement(By)) -> By.name: fname
  Trying main frame -> NoSuchElementException
  Trying iframe google_ads_iframe_/16833175/TryitLeaderboard_0 -> OK
call(WebElement org.openqa.selenium.WebDriver.findElement(By)) -> By.id: textareaCode
  Trying main frame -> OK
call(WebElement org.openqa.selenium.WebDriver.findElement(By)) -> By.name: bt
  Trying main frame -> OK
call(WebElement org.openqa.selenium.WebDriver.findElement(By)) -> By.name: country
  Trying main frame -> NoSuchElementException
  Trying iframe google_ads_iframe_/16833175/TryitLeaderboard_0 -> OK
call(void org.openqa.selenium.WebElement.click()) -> [[ChromeDriver: chrome on XP (5ab9e5f25d169bbc941ab1b08b346c50)] -> class name: seeResult]
  Trying main frame -> OK
call(WebElement org.openqa.selenium.WebDriver.findElement(By)) -> By.name: country
  Trying main frame -> NoSuchElementException
  Trying iframe google_ads_iframe_/16833175/TryitLeaderboard_0 -> OK
Norway
call(WebElement org.openqa.selenium.WebDriver.findElement(By)) -> By.cssSelector: input[type=submit]
  Trying main frame -> NoSuchElementException
  Trying iframe google_ads_iframe_/16833175/TryitLeaderboard_0 -> OK
call(void org.openqa.selenium.WebElement.click()) -> [[ChromeDriver: chrome on XP (5ab9e5f25d169bbc941ab1b08b346c50)] -> css selector: input[type=submit]]
  Trying main frame -> StaleElementReferenceException
  Trying iframe google_ads_iframe_/16833175/TryitLeaderboard_0 -> OK
Related Posts Related Posts :
  • Pros and Cons of Clojure http client libraries
  • use final inside a for each loop
  • Convert java data object to service object
  • Unsupported major.minor version 51.0 while executing JSP
  • How do I display a word diagonally in Java?
  • making sure one task completes before another starts in java
  • My program gives an index out of bounds error
  • Removing duplicate characters in a String (user inputted keyword)
  • Jersey 2.0 Content-Length not set
  • AWS.SimpleQueueService.NonExistentQueue Exception thrown when Accessing Existing SQS queue
  • Where can I find the source code for the com.sun.jdi package?
  • How can I get path of resource under WEB-INF/class folder (java ee web dynamic project)
  • convert a hexadecimal into a decimal via string convert in java
  • error populating a table using jstl
  • If Singletons are bad then how do you store global state for a framework
  • input system where the user inputs the array position of the object followed by a # to indiacte quantity but it gives me
  • Java: when would I ever want to use static methods when I can use a singleton instead?
  • Extracting RSA public key modulus and exponent stored in unsigned char arrays
  • What does "cannot be resolved to a type" mean, and how can I fix it? Java Android 4.0
  • How can I have a callback on stdout/stderr readiness instead of busy polling?
  • How to report AWT/Swing event queue length programmatically?
  • What is the difference between different for loops in Java?
  • Java arrays effective use/alternative
  • EasyMock chained method call producing null pointer exception
  • Installing Java on Windows 8
  • Java: Is it bad practice to write methods that start with "get" when they aren't getters?
  • Can Iterable.filter() skip processing with "constant" (including short circuited) Predicates?
  • How to save edited JTable data to database?
  • Java Packet Sniffer
  • I have a getText error
  • Reading bytestream and writing to file
  • dat file is not get created by buffered writer
  • Converting a pdf to word document using java
  • Measuring memory use of a piece of code at runtime in Java as an on-going functionality of a service
  • What is Matrix.frustumM(mProjMatrix, 0, -ratio, ratio, -1, 1, 3, 7); in OpenGL ES 20?
  • Opening 2 audio-files and playing them simultaneously
  • Accept a word then print every letter of that word on new line in java?
  • How can I send http request to another servlet
  • Reattaching a detached instance: hibernate lock()
  • How to add similar objects into an array?
  • Changing views within an activity
  • Conditions in while loop
  • Why do we need Set and Map for Java Enum
  • Converting a list of objects to a list of optional objects in Java
  • how threads work in java
  • Importing/Exporting Google Contacts in Java App
  • Finding non duplicate element in an array
  • How to prevent JDialog from popping up in front of the JFrame when I close the JFrame?
  • Program hangs indefinitely after two threads print even off numbers alternatively
  • Does JPA support getting data from Database Views?
  • docx4j traversalutil finds no TextElements in the Paragraph node
  • How to create a ListView with AlertDialog.Builder onItemClickListener?
  • Run code after Spring context has been initialized in web app deployed on Tomcat
  • Gradle project does not build when I add RoboBlender
  • java.lang.VerifyError with Mockito 1.10.17
  • Ivy can not resolve the scope of a dependency which is a dependency of a transitive dependency
  • Cannot assign value to static integer
  • Use case of method overriding in PHP
  • Printing and returning the correct list
  • Inferring parameter types in a generic class which are nested generic types of provided arguments
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org