I'm new to intellij idea and maven, and we recently added/used it to build a legacy java project. The original developers have left the company and I haven't used java in 20 years and didn't use these tools, and frankly it was in college (things have changed). We got the project building, and dependencies are resolved, and it has a pom.xml file now, and it generates a jar file according to the artifactId and version in the pom file, in the target dir, and it's 18 kb. However, the original jar file has not rebuilt, and I can see it in a higher project dir and it's 5049 kb. That 5049 kb jar file is what was living on the server (*and it's not rebuilding). We are updating the server name/cred in a file that, and I'm concerned that the 5049 kb file needs to rebuild to reflect the modified cred ini file. I'm not sure if it makes a difference, but this is the project dir structure:
*ServiceNow
DbCred.ini
ServiceNowTask
SourceCode
ServiceNowTAsk
src
main>java>Task>ServiceNowTask>old java files to build
target
ServiceNowTAsk-1-snapshot.jar (new date, 18 kb)
.classpath
.project
pom.xml
ServiceNowTask.iml
ServiceNowTask.jar (old date, 5049 kb)
(read this, ServiceNow is the main dir, with DbCred and ServiceNowTask under it, and under ServiceNowTask is SourceCode, and under that is ServiceNowTask, src, target, ServiceNowTask.iml, ServiceNowTask.jar. etc.) There are other ServiceNow projects at the level of ServiceNowTask, and each contains java files with main, so I think they need to be built separately to create the separate jar files.
The pom file looks like this (do I need to add ServiceNowTask.jar to the pom file?):
<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>Task</groupId>
<artifactId>ServiceNowTask</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>ServiceNowTask</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>18</java.version>
<maven.compiler.source>18</maven.compiler.source>
<maven.compiler.target>18</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.ini4j</groupId>
<artifactId>ini4j</artifactId>
<version>0.5.4</version>
</dependency>
</dependencies>
</project>
My question is, how do I get it to rebuild all jar files, specifically that 5049 kb one that isn't rebuilding?
Update I changed the pom file to this but there are errors:
[ERROR] Malformed POM C:\Users\xxx\OneDrive - Company, Inc\Documents\2022\Java\ServiceNow\ServiceNowTask\SourceCode\ServiceNowTask\pom.xml: Unrecognised tag: 'packaging' (position: START_TAG seen ...</version>\r\n <packaging>... @11:26) @ C:\Users\xxx\OneDrive - Company, Inc\Documents\2022\Java\ServiceNow\ServiceNowTask\SourceCode\ServiceNowTask\pom.xml, line 11, column 26
[FATAL] 'groupId' is missing. @ line 2, column 102
[FATAL] 'artifactId' is missing. @ line 2, column 102
[FATAL] 'version' is missing. @ line 2, column 102
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project [unknown-group-id]:[unknown-artifact-id]:[unknown-version] (C:\Users\xxx\OneDrive - Company, Inc\Documents\2022\Java\ServiceNow\ServiceNowTask\SourceCode\ServiceNowTask\pom.xml) has 4 errors
[ERROR] Malformed POM C:\Users\xxx\OneDrive - Company, Inc\Documents\2022\Java\ServiceNow\ServiceNowTask\SourceCode\ServiceNowTask\pom.xml: Unrecognised tag: 'packaging' (position: START_TAG seen ...</version>\r\n <packaging>... @11:26) @ C:\Users\xxx\OneDrive - Company, Inc\Documents\2022\Java\ServiceNow\ServiceNowTask\SourceCode\ServiceNowTask\pom.xml, line 11, column 26 -> [Help 2]
[ERROR] 'groupId' is missing. @ line 2, column 102
[ERROR] 'artifactId' is missing. @ line 2, column 102
<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>
<build>
<plugins>
<plugin>
<groupId>Task</groupId>
<artifactId>ServiceNowTask</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>assemble-all</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<name>ServiceNowTask</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>18</java.version>
<maven.compiler.source>18</maven.compiler.source>
<maven.compiler.target>18</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.ini4j</groupId>
<artifactId>ini4j</artifactId>
<version>0.5.4</version>
</dependency>
</dependencies>
</project>