Maven compile error with full path to file - java

I am trying to get the full path to the file that the build is failing on however, my compile is only listing the name of the Java file (as shown below). I've searched and have yet to find an answer. There are other developers that are able to see the full path to the file in question...
I'm left to believe that it's because I am on a Ubuntu box and they are using a Mac.
[ERROR] RLXidEventParser.java:[14,0] The import com.google.code.or.binlog.BinlogParserContext cannot be resolved
[ERROR] RLXidEventParser.java:[15,0] The import com.google.code.or.binlog.impl.event.XidEvent cannot be resolved
[ERROR] RLXidEventParser.java:[16,0] The import com.google.code.or.binlog.impl.parser.XidEventParser cannot be resolved
Should look like
[ERROR] /home/bob/src/trunk/rest/of/path/RLXidEventParser.java:[14,0] The import com.google.code.or.binlog.BinlogParserContext cannot be resolved
[ERROR] /home/bob/src/trunk/rest/of/path/RLXidEventParser.java:[15,0] The import com.google.code.or.binlog.impl.event.XidEvent cannot be resolved
[ERROR] /home/bob/src/trunk/rest/of/path/RLXidEventParser.java:[16,0] The import com.google.code.or.binlog.impl.parser.XidEventParser cannot be resolved

Related

io.swagger.v3.parser.OpenAPIV3Parser is not exported

I am trying to parse OPEN API V3 document using swagger-parser-v3 (https://github.com/swagger-api/swagger-parser) 2.0.29 library. But when I compile the code I get the following error.
[ERROR] io.swagger.v3.oas.models.servers.Server is not exported
[ERROR] io.swagger.v3.oas.models.OpenAPI is not exported
[ERROR] io.swagger.v3.oas.models.PathItem is not exported
[ERROR] io.swagger.v3.oas.models.Operation is not exported
[ERROR] io.swagger.v3.oas.models.Paths is not exported
[ERROR] io.swagger.v3.parser.OpenAPIV3Parser is not exported
Here is my code
import io.swagger.v3.parser.OpenAPIV3Parser;
OpenAPI openAPI = new OpenAPIV3Parser().read(swaggerFilePath);
I am seeing this issue while building using maven.
Can someone please help to address this issue.

How to import one google .proto into another using maven and java

I'm trying to import one protobuff definition into another. I am using maven as a build tool. The plugin entry for the proto compiler is
<plugin>
<groupId>com.github.os72</groupId>
<artifactId>protoc-jar-maven-plugin</artifactId>
</plugin>
The import statement looks like
import "state/metadata.proto";
I understood the default location for .proto file in maven to be /src/main/proto.
My proto files are organized as shown below
%find . -name *.proto -print
./src/main/proto/config/PartitionSizeMapping.proto
./src/main/proto/config/Hosts.proto
./src/main/proto/messages/v1/RITServer.proto
./src/main/proto/state/metadata.proto
It is the RITServer.proto file that includes state/metadata.proto.
When I build I get the following error
state/metadata.proto: File not found.
RITServer.proto: Import "state/metadata.proto" was not found or had errors.
RITServer.proto:41:3: "FileMetaData" is not defined.
[ERROR] /data/remote-image-transfer/common/src/main/proto/messages/v1/RITServer.proto [0:0]: state/metadata.proto: File not found.
[ERROR] /data/remote-image-transfer/common/src/main/proto/messages/v1/RITServer.proto [0:0]: RITServer.proto: Import "state/metadata.proto" was not found or had errors.

Javadoc issue package does not exist in java11

Javadoc says package doesnt exist in all the imports. This same setup worked for Java1.8 but with java 11 it has this issue
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9:jar (attach-javadocs) on project esymac: MavenReportException: Error while creating archive:
[ERROR] Exit code: 1 - /home/JDK/com/SelfMonServiceLocator.java:23: error: package com does not exist
[ERROR] import com.SelfMonConstants;
[ERROR] ^
It was working in java1.8 properly with the same classes and pom.xml. But with java11 it fails to find packages.

Maven clean package, error about not found symbol for "Invalid PropertyValueException"

By executing a mvn clean package I see a strange maven output:
[ERROR] /home/user/Desktop/mycompany/myapp/server/src/main/java/com/mycompany/myapp/representation/rest/RestControllerAdvice.java:[8,38] error: cannot find symbol
[ERROR] symbol: class InvalidPropertyValueException
[ERROR] location: package com.mycompany.myapp.exception
So, I searched the row nr. 8 in that class and I found this one
import org.springframework.web.bind.annotation.ExceptionHandler;
But, the line which is referred to InvalidPropertyValueException is 2 rows before:
import com.mycompany.myapp.exception.InvalidPropertyValueException;
And, the strange thing, in the package com.mycompany.myapp.exception I didn't found any class or file named InvalidPropertyValueException. But Eclipse accept it and present me in the option list. And this class don't generate any error or red line.
Try maven->update project this error may go out.
On Project Explorer, right-click on the parent module
select maven, then select Update Project

Package not found error when building the maven project

I have created a maven project and i am going to use a .jar file that already created by someone. I have added it into the class path and used it and there are no errors showing in eclipse. But when i try to clean build the project there is an error as follows.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile
(default-compile) on project DigitalWallet: Compilation failure:
Compilation failure:
[ERROR] /E:/DigitalWallet_V0.1/DigitalWallet/src/main/java/com/MobiOs/config/Log4jConfig.java:[11,23]
package com.mobios.util does not exist
[ERROR] /E:/DigitalWallet_V0.1/DigitalWallet/src/main/java/com/MobiOs/config/Log4jConfig.java:[25,17]
cannot find symbol
[ERROR] symbol: variable LogUtil
[ERROR] location: class com.MobiOs.config.Log4jConfig
[ERROR] /E:/DigitalWallet_V0.1/DigitalWallet/src/main/java/com/MobiOs/config/Log4jConfig.java:[26,17]
cannot find symbol
[ERROR] symbol: variable LogUtil
[ERROR] location: class com.MobiOs.config.Log4jConfig
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
It saying the package com.mobios.util does not exist.
#Configuration
#EnableTransactionManagement
#ComponentScan({ "com.MobiOs.config", "com.mobios.util" })
public class Log4jConfig {
#Bean
public void initilizeLog4j() throws UnsupportedEncodingException {
LogUtil.init("/conf/log4j.xml");
LogUtil.getEventLog().debug("Kasun" +
",SERVICE_INITIALIZED,initialized_logs,,");
}
}
In web Config i have set the component scan also`
#Configuration
#EnableWebMvc
#ComponentScan({ "com.MobiOs", "com.mobios" })
public class WebConfig {
}
But i am getting the above error.
Note : My package name is com.MobiOs.config But the imported jar package name is com.mobios.util
You have two packages with same case insensitive names com.MobiOs to com.mobios which represent physically two directories with same case insensitive names. This can lead to an issue if your file system is case insensitive, or expect specific case as lower case.
Java's package names should be lower case:
Package names are written in all lower case to avoid conflict with the names of classes or interfaces.
If you are not convinced, see comment:
On some versions of some Windows file systems names that are entered in all caps are displayed in all lowercase as the default. This is probably to be friendly towards files from systems that don’t distiguish case — these may come in in all uppercase and look better in all lowercase. While the file name is still uppercase behind the scenes, this may have caused confusion

Categories

Resources