0% found this document useful (0 votes)
297 views

Mavenplugin 2

The document contains code for a Java application called PrimeSum that uses Maven. It defines a PrimeSum class with a main method that calls a primesum method. This method returns 77 regardless of the input maximum number. The accompanying Maven POM file configures the project with dependencies, plugins for compilation and testing.

Uploaded by

Pratik Kumar Jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
297 views

Mavenplugin 2

The document contains code for a Java application called PrimeSum that uses Maven. It defines a PrimeSum class with a main method that calls a primesum method. This method returns 77 regardless of the input maximum number. The accompanying Maven POM file configures the project with dependencies, plugins for compilation and testing.

Uploaded by

Pratik Kumar Jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

package javaApp;

public class PrimeSum {

public static void main(String[] args) {


System.out.println(primesum(20));
}

static long primesum(int maxNum) {


int sum = 0, num =0;
if(maxNum<=0) {
sum = 0;
}
else{
sum =77;
}
return sum;
}

<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>PrimeSum</groupId>
<artifactId>PrimeSum</artifactId>
<version>0.0.1-SNAPSHOT</version>
<!--Insert your code here-->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>javaApp.PrimeSum</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.20</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

This study source was downloaded by 100000755048488 from CourseHero.com on 04-10-2022 03:12:46 GMT -05:00

https://www.coursehero.com/file/70752584/mavenplugin2txt/
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

This study source was downloaded by 100000755048488 from CourseHero.com on 04-10-2022 03:12:46 GMT -05:00

https://www.coursehero.com/file/70752584/mavenplugin2txt/
Powered by TCPDF (www.tcpdf.org)

You might also like