Skip to content

scoverage:report cannot run with --offline flag #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zzgzy opened this issue Jun 21, 2020 · 1 comment
Closed

scoverage:report cannot run with --offline flag #84

zzgzy opened this issue Jun 21, 2020 · 1 comment

Comments

@zzgzy
Copy link

zzgzy commented Jun 21, 2020

I am using mvn -U dependency:resolve-plugins dependency:go-offline install to pre-download everything and when running mvn --offline scoverage:report, I got the POM for org.scoverage:scalac-scoverage-plugin_2.10:jar:1.3.0 is missing, no dependency information available error.

The POM:

<?xml version="1.0" encoding="UTF-8"?>
<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>com.microsoft.m365a.dna.testscalaapp</groupId>
    <artifactId>testscalaapp</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <spark.version>2.4.0</spark.version>
        <scala.version.major>2.11</scala.version.major>
        <scala.version.minor>12</scala.version.minor>
        <scala.version>${scala.version.major}.${scala.version.minor}</scala.version>
        <scoverage.scalacPluginVersion>1.4.0</scoverage.scalacPluginVersion>
        <scoverage.plugin.version>1.4.0</scoverage.plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_${scala.version.major}</artifactId>
            <version>${spark.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-sql_${scala.version.major}</artifactId>
            <version>${spark.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-streaming_${scala.version.major}</artifactId>
            <version>${spark.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-mllib_${scala.version.major}</artifactId>
            <version>${spark.version}</version>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>org.apache.maven.surefire</groupId>-->
<!--            <artifactId>maven-surefire-common</artifactId>-->
<!--            <version>2.22.0</version>-->
<!--        </dependency>-->
        <dependency>
            <groupId>org.jmockit</groupId>
            <artifactId>jmockit</artifactId>
            <version>1.34</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>net.alchim31.maven</groupId>
                    <artifactId>scala-maven-plugin</artifactId>
                    <version>3.2.2</version>
                    <executions>
                        <execution>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.scoverage</groupId>
                    <artifactId>scoverage-maven-plugin</artifactId>
                    <version>1.3.0</version>
                    <configuration>
                        <aggregate>true</aggregate>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>net.alchim31.maven</groupId>
                    <artifactId>scala-maven-plugin</artifactId>
                    <version>3.2.2</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>compile</goal>
                                <goal>testCompile</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <scalaVersion>${scala.version}</scalaVersion>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.0</version>
                    <configuration>
                        <forkCount>0</forkCount>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.surefire</groupId>
                    <artifactId>maven-surefire-common</artifactId>
                    <version>2.22.0</version>
                </plugin>

                <plugin>
                    <groupId>org.scoverage</groupId>
                    <artifactId>scoverage-maven-plugin</artifactId>
                    <version>1.3.0</version>
                </plugin>

                <plugin>
                    <groupId>org.scoverage</groupId>
                    <artifactId>scoverage-maven-plugin</artifactId>
                    <version>${scoverage.plugin.version}</version>
                    <configuration>
                        <scalacPluginVersion>1.4.0</scalacPluginVersion>
                    </configuration>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.scoverage</groupId>
                <artifactId>scoverage-maven-plugin</artifactId>
                <version>1.3.0</version>
            </plugin>
        </plugins>
    </reporting>

</project>

The problem is that It will only download the .jar but not .pom files for me. In the folder, I could only see scalac-scoverage-plugin_2.10-1.3.0.jar and scalac-scoverage-plugin_2.10-1.3.0.jar.sha1 but no pom file. Could anyone help and provide some insights on it? Thank you in advance!

@jozic
Copy link
Collaborator

jozic commented Dec 15, 2023

@zzgzy the plugin adds some artifacts dynamically during execution, so only getting dependencies while online won't work. What you can do is execute it once when online and then go offline. I think it should help. Lmk if not.

Please reopen if you think we can do better here.

@jozic jozic closed this as completed Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants